Quick start
1. Install
You need Node.js 20 or newer and npm. Install the CLI from npm:
npm install --global @sharge/cli@latestIf an AI agent will use sharge, install the five Skills from this repository for your user:
npx skills add shargedev/sharge-cli -y -gFor overseas use, select the Open Platform before logging in:
sharge config set base-url https://app.loomos.ai/sharge config showsharge loginCheck that the command is available:
sharge versionsharge --helpWhen helping with installation, an agent should install the CLI and Skills, set the base URL, then run sharge login --no-browser. It should give the complete authorization URL to the person and let them confirm the browser page.
2. Log in
sharge loginThe CLI attempts to open a browser and prints the complete authorization URL and a visual verification code. It waits quietly for authorization; it does not repeatedly print waiting messages.
If a browser cannot open automatically:
sharge login --no-browserOpen the complete URL from the CLI in any browser. Use the code only to confirm that the browser page matches this CLI session; do not type it back into the terminal.
Verify the login:
sharge auth statussharge auth status --json3. Read data
# Read one page of AI Live Photo itemssharge notes list --limit 20 --json
# Read a Calendar time rangesharge calendar list \ --start 2026-07-30T00:00:00+08:00 \ --end 2026-07-31T00:00:00+08:00 \ --json
# Search Recordingssharge recordings search "project review" --limit 10 --json
# Read AI Diary entries for a monthsharge diary list 2026-07 --json4. Let the agent discover commands
Do not guess arguments. Start at the root help, then narrow down:
sharge --help --jsonsharge calendar --help --jsonsharge calendar create --help --jsonGenerate an input template offline and preview a write before execution:
sharge calendar create --generate-input > calendar-create.jsonsharge calendar create --input @calendar-create.json --dry-run --jsonsharge calendar create --input @calendar-create.json --jsonRun the final command only after the plan is confirmed.
5. Read the next page
List commands do not automatically fetch all data. When a response has has_more: true, use its next_cursor explicitly:
sharge notes list --cursor 123 --limit 20 --jsonA cursor is opaque. Do not calculate, modify, or guess the next one.
6. Switch environments
The CLI’s built-in default is the China production origin, https://ai.shargetech.com. For overseas use:
sharge config set base-url https://app.loomos.ai/sharge config showsharge loginThe CLI normalizes the trailing slash, so config show displays https://app.loomos.ai. API keys are tied to a base URL. Switching may restore one cached credential; log in if no credential is available for the selected URL.
7. Handle errors
Text errors go to stderr with a suggested next action. Agents should request JSON and inspect error.type, error.retryable, error.outcome, error.requiredScopes, error.nextActions, meta.requestId, and the process exit code.
sharge notes list --jsonThe CLI does not retry automatically. Decide whether to retry only after checking the operation’s safety and the error fields.