Skip to content
Docs
Esc
↑↓navigate↵open⌘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 repository from the Repositories sidebar tab, then visit /cli on that same server, select the repository and create a credential. It permits reading and publishing in the selected repository 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. Each organization can have multiple repositories. Open /repositories to browse or create them; /repositories/REPOSITORY_ID opens one repository and its file tree. PROJECT_ID and /api/projects/:id are the API names for repository IDs. Creation uses the authenticated POST /api/projects with { "name": "Research" } and returns the new repository. GET /api/projects returns {projects} for your organization. Creating another repository leaves existing files and history intact.

Choose the intended repository on /cli: credentials remain scoped to that repository. Use separate clone directories for separate repositories.

Was this page helpful?