#Use Memos CLI
Memos CLI is a command-line interface tool for managing memos through a self-hosted API. It allows users to retrieve, create, and update memos efficiently.
- Retrieve all memos from the API
- Create new memos (placeholder functionality)
- Update existing memos (single or bulk update)
- Save memos as local files
- Maintain memo metadata in a JSON file
- Ensure you have Rust and Cargo installed on your system.
- Clone this repository:
git clone https://github.com/yourusername/memos-cli.git cd use-memos-cli
- Build the project:
cargo build --release
- The binary will be available in
target/release/use-memos-cli
Before using the CLI, make sure to set the following environment variables:
MEMOAPI
: Your API authentication tokenMEMO_DOMAIN
: The domain of your self-hosted memo instance
You can set these in a .env
file in the project root.
use-memos-cli [OPTIONS] --endpoint <ENDPOINT>
-m, --memo-domain <MEMO_DOMAIN>
: Memo domain of self-hosted instance-e, --endpoint <ENDPOINT>
: API endpoint to call (getMemos, createMemo, updateMemo)-o, --output-dir <OUTPUT_DIR>
: Output directory for files [default: content]-v, --verbose
: Verbose mode-n, --memo-name <MEMO_NAME>
: Memo name or uid (for single memo operations)-c, --content <CONTENT>
: Optional content for memo creation or update--bulk-update
: Flag for bulk update of memos
-
Retrieve all memos:
use-memos-cli --endpoint getMemos
-
Update a single memo:
use-memos-cli --endpoint updateMemo --memo-name <MEMO_UID> --content "Updated content"
-
Bulk update all memos:
use-memos-cli --endpoint updateMemo --bulk-update
src/
main.rs
: Entry point of the applicationcli.rs
: CLI argument parsingutils.rs
: Utility functionsapi/
mod.rs
: API module definitionsgetMemos.rs
: Functions for retrieving memoscreateMemo.rs
: Functions for creating memos (placeholder)updateMemo.rs
: Functions for updating memos
Contributions are welcome! Please feel free to submit a Pull Request.