A terminal-first AI assistant that manages its own runtime

Docent is a private AI assistant that runs from the terminal. It chats with your PDFs and Office files, searches the web, and connects MCP servers. If no local agent is running the CLI downloads the framework and models it needs and starts one itself. The command installs as both docent and smartloop; the two are the same executable.

Installation that adapts to your environment

On macOS and Linux a single piped curl command fetches and runs the installer. On Windows PowerShell you run an invoked script. The binary targets a cargo bin directory when a Rust toolchain already owns that directory because it is already on PATH. Otherwise it lands in a local bin folder. If the chosen directory is not on PATH the installer appends an export line to your shell startup file so a new terminal picks it up. Re-running the installer will not append that line twice. On Windows the binary goes to a user profile bin folder and the installer sets your user PATH through the registry. Restart the shell to pick it up. An environment variable can override the install directory or pin a specific release. Prebuilt binaries ship for Linux x86_64 and aarch64 statically linked against musl macOS Apple Silicon and Intel and Windows x86_64. You can also build from source with cargo install --path . which requires Rust 2024 edition.

The first-run bootstrap sequence

Any command that talks to the agent starts it when none is running. It listens on a free port it picks itself and writes that port to a server port file where the CLI reads it. On first use several steps occur in sequence. First the agent framework downloads from a framework archive into a versioned folder. The Studio desktop application uses the same folder and marker files so the two share one install. Then the agent starts in the background with the home directory set logging to a server log. The agent keeps running after the CLI exits. Then the embedding model downloads into the workspace models embeddings folder for document search. The model is bge-m3-Q4_K_M.gguf at roughly 417 MB. Then the agent bootstrap runs which downloads the default base model creates the default project and loads the model. Each step is skipped when its files are already present. Progress displays as a checklist on stderr under a banner that redraws in place with the active download bar in a distinctive pink. A step without a bar shows elapsed time once it runs past a couple of seconds and ends with setup complete in roughly one minute twelve seconds. When stderr is not a terminal each step prints one line as it finishes instead. The model enable command shows the same checklist for its download.

Controlling the agent lifecycle

You can start or stop the agent explicitly with agent start and agent stop commands. This lets you run the bootstrap up front or shut down the background process when you are done.

Authentication that bridges browser and terminal

The login command opens the web app in your browser the same way the desktop app does. Once you sign in the page hands the session to the local agent which stores it and uses it for every platform call. The command waits up to five minutes and prints the account it signed in as. If the browser does not open you can visit the URL it prints. You can also sign in with a token instead by running login with a token flag and pasting it at the prompt where input is hidden or using the token flag with a value or piping it on stdin in scripts. Logout clears stored credentials.

Projects as isolated workspaces

Projects keep skills documents and their index separate. List projects outputs a table showing each project ID name and whether it is a system project. Create a project from a blank template with a name and optional description. A blank project starts with no skills; the service seeds it with workspace defaults. Everything a project stores lives under the service own project directory so there is no working directory to choose. You can import a project from an archive produced by an earlier export. The import gets a fresh project ID and MCP OAuth credentials are stripped from the archive on the way in. You can rename the imported project with an optional name flag. Delete a project with its project ID.

Agent status and per-project processes

The agent status command shows which endpoint the CLI uses whether the local agent is running there which model it has loaded and the per-project agents it has started. Output includes the endpoint URL status healthy model name context size and process ID and memory. It also lists each project with its PID port alive time and memory. The endpoint is the URL the CLI talks to either from an environment variable or the default. The command exits with status one when the agent cannot be reached there.

Interactive chat with live progress

Running the command on its own opens a full-screen app laid out like a familiar code editor. While a reply runs a live status line above the prompt shows the agent current step web search document lookup model selection and for how long with a line per running download. The finished reply keeps its sources and the model that answered. References appear as a numbered list. The orchestrator picks which model serves each turn from the models enabled for the project. You can pass an initial prompt to send immediately. Options let you chat in a specific project resume an existing session or run line by line instead of the full-screen app. Keyboard shortcuts include help interrupt new line scroll copy and file drop for images or documents. A command palette handles login models MCP servers status usage upgrade clear help and quit.

Line-by-line mode for scripts and pipes

When stdin or stdout is not a terminal or with the plain flag the chat runs line by line. Without a project flag it lists your projects and asks which one to chat in then keeps reading prompts from stdin until EOF or a quit command. The response streams token by token on stdout and the agent progress prints on stderr as step message lines so it does not interleave with the answer. When the answer draws on documents or web pages the sources follow as a numbered list on stdout.

Model management across projects

List models shows what is available and its state for the current project. Enable or disable a model by name. Enable downloads the weights first when they are not on disk yet showing progress and only then switches the model on. Weights are shared across projects so each model downloads once. Models marked with a sign in tag need login first. Disable also unloads the model from memory. All three commands take a project flag to act on a project other than the current one. The sl-mini orchestrator is always on and is not listed.

Environment variables for deployment control

The CLI connects to the local agent on whatever port it picked stored in a server port file. Point it elsewhere with an environment variable. With that variable set the CLI only connects; it never installs or starts an agent for that URL. Three environment variables control behavior: the home directory where the framework workspace models and logs live the port to pin the managed local agent to and where the framework archive downloads from.

Open source under MIT

The project is released under the MIT License.