Skip to content
flaxodevPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

creed-cli

Use and manage Creed directly from the terminal — agent workflows, scripts and local development environments.

Creed is one personal context file every AI reads before it answers. creed-cli lets you read, edit, propose, and script that file from any terminal, and wrap the local dev lifecycle (setup, doctor, dev) without leaving the shell.

Node 22+ License: MIT Version

Install

npm i -g creed-cli
# both bins work
creed --help
creed-cli --help

# zero-install
npx creed-cli --help
npx creed-cli --agent cursor call read_creed --json

Requires Node 22+.

Quick start

# 1. Point at your Creed (defaults to http://localhost:3001 for Open local dev)
creed auth login
#  → opens browser, OAuth PKCE + loopback, or paste a token for CI
#  → or: creed auth login --site https://your-creed.example --token xt_read_...

creed auth status
creed read                  # full file as Markdown
creed read --json | jq .    # structured
creed sections list
creed sections get beliefs --json
echo "New body" | creed sections update beliefs --file -
creed proposal list --status pending
creed activity --limit 20
creed search "goals"
creed export -o creed.md
creed pull && vim creed.md && creed push -m "tighten goals"

Agent workflow

The first run opens the Creed OAuth screen — the same one MCP agents use.

# use inside any agent prompt
npx creed-cli --agent opencode call read_creed --json
# or pipe into jq/scripts
creed read --json | jq '.sections[] | {id, name}'

Non-interactive / CI:

CREED_SITE_URL=https://your-creed.example CREED_TOKEN=xt_read_... creed read
creed auth login --token xt_read_... --site https://your-creed.example

Local dev

# One command to self-host — no IDE or agent needed (answers: hosting without IDE)
creed up --yes            # clone + install + setup + supabase start + next dev — warm runs ~3s
creed up --detach --open  # background + open browser when healthy
creed up ./creed --port 3001 --no-supabase  # custom dir / hosted Supabase
creed up --json           # machine-readable

# Granular steps (also available)
creed init                # git clone + npm i + setup (inside giter/creed checkout or fresh)
creed setup               # wraps @creed/open installer (env, secrets, Supabase link, migrations)
creed doctor              # read-only checks (prereqs, env, Supabase, schema)
creed dev                 # supabase start + next dev -p 3001
creed dev --no-supabase   # when you run Supabase elsewhere
# aliases: creed self-host, creed quickstart, creed host

Config

creed config get
creed config set siteUrl https://your-creed.example
creed config set defaultCreed <id>
creed config path         # where credentials live (~/.config/creed/)

Credentials live in ~/.config/creed/credentials.json (0600, OS keychain when available) or CREED_TOKEN env.

Development

git clone https://github.com/hpbrn/creed-cli.git
cd creed-cli
npm install
npm run build
npm run typecheck
node --test tests/*.test.ts   # unit + integration (mock)

Live test against self-hosted Creed (requires giter/creed with supabase start and npm run dev on :3001):

# 1. Self-host Creed
cd giter/creed && npm install && npm run setup && npm run dev

# 2. In another terminal, test CLI
cd giter/creed-cli
CREED_CONFIG_DIR=/tmp/test npm run build
node dist/cli.js auth login --site http://localhost:3001 --token xt_read_...
node dist/cli.js read | head
node dist/cli.js doctor

Architecture

  • src/lib/config.ts — XDG ~/.config/creed/ (0600), CREED_SITE_URL/CREED_TOKEN env, normalizeSiteUrl
  • src/lib/api.ts — POST /mcp JSON-RPC for OAuth (creed_at_…), GET /api/creed + POST /api/creed/proposals for PAT (xt_*), parseMarkdownSections fallback
  • src/lib/auth.ts — OAuth PKCE + loopback http://127.0.0.1:<port>/callback, open() browser
  • src/commands/* — auth, read, write, proposals, local (export/pull/push/doctor/setup/dev/init/call), up (up/self-host/quickstart/host), config
  • src/utils/output.ts — chalk/table/printJson

See giter/creed for server routes: packages/creed-app/app/mcp/route.ts, packages/creed-app/app/api/creed/*, packages/creed-core/creed-data.ts.

Security

  • Tokens stored 0600 at ~/.config/creed/credentials.json (OS keychain when available), never logged
  • Authorization: Bearer only — no ?token= query string (leaks in Referer/logs)
  • CREED_ENCRYPTION_SECRET encrypts at rest (packages/integrations/secret-crypto.ts)

Docs

  • Creed app: giter/creed
  • Creed docs: https://docs.creed.md
  • This CLI mirrors the MCP tools read_creed, creed_get_section, creed_update_section, creed_search, etc. (packages/creed-app/app/mcp/route.ts)

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages