Package: quare
quareInteract with Quip from the command line.Introductionquare allows interaction withQuipvia the command line. Whilequareis in alpha, there are some features you may find useful:Pipe the output of a command to a chat or document and format it as monospace.Archive messages by piping them into a local fileSecurely store authentication tokens for multiple Quip instances.This tool is in its early stages of development, and is subject to change (or abandonment) at any time. Use at your own risk.Installation$pipxinstallquareUsageAuthenticationStore a Quip API token (See:https://quip.com/dev/token):$quareauthToken: long_token_stringToken stored.If you have multiple Quip instances (like multiple Slack Workspaces), you can specify an alias for them. You can also pass your token directly toauth:$quaremsgauth--aliastest_server--token't1DJBQWBXHCYgh1=|2983928392|nYtRFIhV7nl4...'WhoamiTo see information about the logged in user:$quaremsgwhoami┌Default───────┬───────────────┐│ Name         │ Tests Testeri │├──────────────┼───────────────┤│ Email(s)     │ t@testz.dev   │├──────────────┼───────────────┤│ Quip User ID │ mRLA6Zdn3PO   │└──────────────┴───────────────┘Sending messagesThe destination may be a document or chat:$quaremsgsend--roomroom_id--content'Hello everyone!'Pipe content fromstdinMessage content can be piped fromstdin:$uname-a|quaremsgsend--roomroom_id--content'-'While Quip allows formatting messages using some markdown markup, it doesn't recognize markdown code blocks ("```"). To define a code block, use the--monospaceoption:$dmesg|tail-n5|quaremsgsend--roomroom_id--content'-'--monospaceReceiving messagesStream to stdoutTo stream every message appearing in the Updates tab:$quaremsgstreamStreaming updates... press Ctrl-C to exit.[Sun Jun 30 17:23:09 2019 | (Test Log) | @Tests Testeri] ok okDump the content of a chat roomTo get the last 5 messages in a chat room or document:$quaremsgget--roomroom_id--last5[Sat Jun 29 03:19:09 2019 | @Tester Testeri] This is a monologue![Sat Jun 29 16:00:12 2019 | @Tester Testeri] ok[Sat Jun 29 16:34:51 2019 | @Tester Testeri] I'm done![Sun Jun 30 17:30:14 2019 | @Tester Testeri] 🌮[Sun Jun 30 17:30:27 2019 | @Tester Testeri] 🥃To get the last 2 messages as JSON:$quaremsgget-r"IcTAAAtVxXb"--last2--json[{"author_id": "mRLA6Zdn3PO", "visible": true, "id": "IcderpEe8wG", "created_usec": 1561849212672040, "updated_usec": 1561849212696571, "text": "ok", "author_name": "Tester Testeri"}, {"author_id": "mRLA6Zdn3PO", "visible": true, "id": "IcNodg7n2Tx", "created_usec": 1561851291612434, "updated_usec": 1561851291620308, "text": "chat", "author_name": "Tester Testeri"}]To dump the last 200 messages in a chat room into a text file:$quaremsgget--roomroom_id--last200>interesting_conversation.logTo get all messages since a datetime:$quaremsgget--roomroom_id--since2019-01-01T00:32:00Z>greppable_archive.logThe--sinceoption recognizes any date recognized bydateparser:$quaremsgget--roomroom_id--since'Monday'>this_week.log$quaremsgget--roomroom_id--since'2 months ago'>this_quarter.logEditing documentsTo append a markdown file to an existing document$quaredocappend--idxxxDoc_IDxxx--file/tmp/foo.md$cat/tmp/foo.md|quaredocappend--idxxxDoc_IDxxx--file-To append a markdown-format string to an existing document$quaredocappend--idxxxDoc_IDxxx--content'## Headline\n\n'DevelopmentThis work is licensed under the terms of theLGPL-3.0.ContributionsSee CONTRIBUTING.rst