@aiagentwiki/cli
v0.7.0
Published
AgentWiki CLI — manage notes, docs, media, publish sites, and query your knowledge base from the terminal.
Downloads
280
Maintainers
Readme
@aiagentwiki/cli
Command-line interface for AgentWiki — manage notes, documents, media, publish static sites, and query your knowledge base from the terminal.
Install
# Global install
npm i -g @aiagentwiki/cli
# Or run without installing
npx @aiagentwiki/cli --helpRequires Node.js >=20.
Usage
agentwiki --help
agentwiki login --api-key aw_xxxxx
agentwiki whoamiAuthentication
Credentials are resolved with this precedence (highest → lowest):
- Environment variables —
AGENTWIKI_API_KEY,AGENTWIKI_API_URL - Credentials file —
~/.agentwiki/credentials.json(written byagentwiki login) - Defaults —
apiUrl = https://api.agentwiki.cc
Environment variables
| Variable | Purpose |
|---|---|
| AGENTWIKI_API_KEY | API key — bypasses login, ideal for CI/Docker/automation |
| AGENTWIKI_API_URL | Override API base URL (self-hosted, staging) |
| AGENTWIKI_APP_URL | Override app base URL for human-openable share/publish links |
Example (GitHub Actions):
- name: Publish site via AgentWiki CLI
env:
AGENTWIKI_API_KEY: ${{ secrets.AGENTWIKI_API_KEY }}
run: npx @aiagentwiki/cli sites deploy ./build --name my-siteUse agentwiki whoami to verify which source (env/file/default) is in effect.
Documents
agentwiki doc list
agentwiki doc get <id> --markdown
agentwiki doc create --title "Runbook" --description "Deployment runbook for AgentWiki production" --content "# Runbook"
agentwiki doc create --title "Runbook" --description "Deployment runbook for AgentWiki production" --file ./runbook.md
agentwiki doc upload ./runbook.md --description "Deployment runbook for AgentWiki production" --json
agentwiki doc share <id> --expires 365
agentwiki doc share <id> --json
agentwiki doc publish <id> --description "Public deployment runbook for operators"doc upload <file> accepts .md, .markdown, and .txt. It infers the title from --title, frontmatter title:, first # Heading, then filename.
Create/upload/publish commands require a concise, specific --description; generic placeholders like file, upload, or document are rejected.
See the main repository README for the full command reference.
Secrets
Secrets are encrypted at rest and masked by default.
agentwiki secrets list --env dev
agentwiki secrets set API_TOKEN --env dev --value "$API_TOKEN" --reason "bootstrap"
agentwiki secrets update <id> --expected-version 1 --value "$API_TOKEN" --reason "rotate"
agentwiki secrets get <id>
agentwiki secrets get <id> --reveal --reason "debug deploy"
agentwiki secrets export --env dev
agentwiki secrets export --env dev --reveal --reason "local smoke"
agentwiki secrets run --env dev --keys API_TOKEN --reason "local test" -- npm testRaw reveal, raw export, and env injection require matching secret:* or concrete secret scopes plus an explicit grant.
License
MIT
