movesdk-cli
v1.2.1
Published
CLI for Dolphin Move SDK
Maintainers
Readme
MOVE SDK CLI
Command-line tools for working with the MOVE SDK admin APIs.
More information about MOVE SDK is available in the documentation.
Installation
Install dependencies:
npm installRun the CLI locally:
node movesdk.js <command>If you want to use it as a command after installing the package globally:
npm install -g .
movesdk <command>Commands
clone: Clone one of the sample projects.login: Log in and store credentials locally.logout: Remove stored credentials and saved project settings.auth status: Check whether credentials are present and still valid.projects: List projects and optionally save a default project.projects add: Create a new project.create-project: Create a new project from the top-level command.delete-project: Delete a project.services: View or update project services/settings.keys: List API keys for a project.keys add: Create a new API key for a project.keys delete: Delete a key by API key value.receivers: Manage timeline, generic, and assistance notifier receivers.help: Print the documentation URL.open-project: Print the MOVE documentation URL.
Credential Storage
Credentials and saved project settings are stored in a stable OS-specific data directory instead of the current working directory.
- Linux:
$XDG_DATA_HOME/movesdk - Linux fallback:
~/.local/share/movesdk - macOS:
~/Library/movesdk - Windows:
%APPDATA%/movesdk
The CLI also migrates legacy ./credentials.json and ./settings.json files into that data directory the first time they are accessed.
Working With Projects
Some commands operate on the currently selected project:
projectsserviceskeysreceiversdelete-projectopen-project
You can save a default project by running:
node movesdk.js projectsCreate a new project non-interactively:
node movesdk.js projects add --name demo --default-valuesYou can also use the legacy top-level command:
node movesdk.js create-projectYou can also override the saved project for a single command with --project-id:
node movesdk.js services --project-id 1234
node movesdk.js keys --project-id 1234
node movesdk.js delete-project --project-id 1234
node movesdk.js receivers list --type generic --project-id 1234Most read-style commands also support --json if you want machine-readable output instead of tables.
To save a specific project directly from the command line:
node movesdk.js projects --project-id 1234Typical Usage
Log in first:
node movesdk.js loginFor non-interactive login, pass the username explicitly and pipe the password over stdin:
printf '%s\n' 'your-password' | node movesdk.js login --username [email protected] --password-stdin
printf '%s\n' 'your-password' | movesdk login --username [email protected] --password-stdinList projects and save a default:
node movesdk.js projectsCreate a project:
node movesdk.js create-projectInspect or update services for the saved project:
node movesdk.js servicesFetch keys for a specific project without changing the saved default:
node movesdk.js keys --project-id 1234
node movesdk.js keys --project-id 1234 --json
node movesdk.js keys --project-id 1234 --show-secretsKey values are masked by default in table and JSON output. Use --show-secrets only when you explicitly need the full key value.
Create a new API key:
node movesdk.js keys add --project-id 1234 --audience mobile-app --write-only
node movesdk.js keys add --project-id 1234 --audience mobile-app --jsonkeys add sends the request body defined in the OpenAPI YAML:
audiencewriteOnly
The newly created key is shown in full right after creation so you can copy it once.
Delete a key by passing the API key value from keys --show-secrets:
node movesdk.js keys delete super-secret-api-key --project-id 1234 --yesIf you omit --yes, the CLI asks for a DELETE confirmation in an interactive terminal.
List generic notifier receivers for a project:
node movesdk.js receivers list --type generic --project-id 1234If you need the token in the output, add --show-secrets:
node movesdk.js receivers list --type timeline --project-id 1234 --show-secretsAdd a timeline receiver:
node movesdk.js receivers add --type timeline --project-id 1234 --url https://example.com/webhook --token secret-tokenUpdate a receiver by its receiver ID:
node movesdk.js receivers update 55 --type assistance --project-id 1234 --url https://example.com/assistance --token new-tokenDelete a receiver:
node movesdk.js receivers delete 55 --type generic --project-id 1234
node movesdk.js receivers delete 55 --type generic --project-id 1234 --yesFor non-interactive usage, receivers add and receivers update should be called with the values you want to set as flags. receivers delete can be run without a prompt by passing --yes.
receivers update uses the numeric receiver ID from receivers list, not the URL. That keeps updates stable even if multiple receivers share a URL or the URL changes.
Receiver create and update requests send only the receiver URL, token, and project id.
Project deletion also supports --yes:
node movesdk.js delete-project --project-id 1234 --yesThe repository also includes a small automated test suite:
npm testLog out and clear local state:
node movesdk.js logoutCheck auth status from a Bash script:
node movesdk.js auth status
echo $?Use --json if you want machine-readable output:
node movesdk.js auth status --jsonExit codes for auth status:
0: authenticated1: not logged in2: token expired or refresh failed
Contributing
Contributions are welcome.
License
This project is licensed under the MIT License.
