Skip to content
Docs
Esc
navigateopen⌘Jpreview

First commit

Install the CLI, connect a project, and publish your first files.

Requires Node 24 and Git. From this repository, run npm install, then use npm exec -- knowledge --help, or run node /absolute/path/to/knowledge/apps/cli/bin/knowledge.mjs from any directory. For the examples below, put apps/cli/bin on PATH. This workspace package is not published to npm yet.

Create a project in the web app, then visit /cli on that same server. Select the project and create a credential. It permits reading and publishing in that project for at most 24 hours. The server rechecks the original sign-in session and account membership on every request. Sign out that session to revoke its delegated credentials; account removal and session-secret rotation also end access. Per-token management and unattended service credentials are subsequent work. Credentials stay out of the checkout and out of Git subprocess environments.

# Paste the credential without echoing it or placing it in shell history.
read -r -s KNOWLEDGE_TOKEN
export KNOWLEDGE_TOKEN

knowledge clone PROJECT_ID research --url https://your-knowledge-server.example
cd research
# Create or copy your documents into this directory.
knowledge status
knowledge add notes.md reports/
knowledge diff --cached
knowledge commit -m "Add research and source reports"
knowledge log
knowledge show HEAD:notes.md

To attach a directory containing files to an empty project, use knowledge init --project PROJECT_ID --url URL there, then add and commit. For a project with history, clone first so deletions and edits have a known base. The initial version requires project creation through the web app.

Was this page helpful?