config.db, environment variables, and command flags.
State directory
By default, state lives under~/.notewise.
Set
NOTEWISE_HOME to move this state root.
Older installs stored config in a
~/.notewise/config.env text file. On the
first run after upgrading, NoteWise imports any existing config.env into
config.db and deletes the file — no manual migration needed.Practical precedence
For a command run, command-line flags win. ForOUTPUT_DIR, the value in config.db is used unless --output is passed. Other settings use environment variables, then config.db, then code defaults.
Custom OpenAI-compatible endpoints
notewise setup lists built-in providers, each saved custom endpoint by name, and
Add custom OpenAI-compatible endpoint. Select a saved endpoint to use its
current configuration, or choose Add to enter a name, base URL, and API key.
For either path, setup requests the endpoint’s current /v1/models list, requires
you to select a discovered model, and sends a tiny completion request to verify
that selection. The verification can incur a small provider charge.
Adding an endpoint appends it to the registry. Adding a name that normalizes to an
existing name replaces only that endpoint after discovery and verification succeed;
other saved endpoints remain unchanged. Names are unique after normalization and
cannot use LiteLLM provider prefixes. Base URLs must be absolute HTTPS URLs, except
explicit loopback endpoints may use HTTP. Setup works out the API base URL itself:
it uses the URL exactly as you enter it when the endpoint answers on it, and retries
once with /v1 appended when it does not, then saves whichever URL worked. A bare
origin always gains the /v1 segment, a path that already names a version (v1,
v1beta, v2) is left alone, and a pasted request path such as /chat/completions
or /models is trimmed back to the base. If no form answers, the error names every
URL that was tried and why each one failed.
The registry is stored as one row per endpoint (name, base_url, api_key) in a
dedicated table in ~/.notewise/config.db, managed with notewise inference list|add|update|delete. You can also override the whole registry for one process
with the CUSTOM_LLM_ENDPOINTS environment variable, a compact JSON array with the
same fields — this safe two-profile example uses placeholder credentials:
<name>/<model-id>. When that name exactly matches
a saved profile prefix, NoteWise uses that profile’s endpoint configuration and
sends the compatible request as openai/<model-id>. CUSTOM_LLM_ENDPOINTS is a
secret-bearing value: notewise config masks the entire value, and NoteWise never
copies its credentials into ambient environment variables.
Common config keys
Provider API keys and provider auth keys are also accepted in
config.db (via notewise config set KEY VALUE) when they are listed in source constants. Omit VALUE for a sensitive key to be prompted for it with hidden input instead of typing it as a plain CLI argument.
Commands
notewise config (no arguments) masks secrets before printing all settings.
notewise config keys lists every key get/set/unset accept, since the
full set (provider API keys, provider auth keys, and core settings) isn’t
obvious up front. notewise config get/set/unset read or write one key at a
time; the KEY argument is optional on all three — omit it and NoteWise
lists every allowed key with a number and prompts for a pick. set validates
the new value immediately and reports an error without leaving the process in
a broken state if it’s invalid (e.g. TEMPERATURE out of range). notewise config edit is an interactive, category-grouped
browser/editor over the same keys (Model & Generation, Concurrency &
Performance, Output & Transcripts, Custom Endpoints, OAuth Token
Directories, Provider API Keys, Provider Auth & Cloud Credentials) — pick a
category, pick a key, then set or unset it, without needing to already know
its exact name; secrets stay masked and prompt with hidden input, same as
set. The Custom Endpoints category is a table-based add/update/delete
manager over the same saved endpoint rows as notewise inference list|add|update|delete, not a raw-JSON editor for CUSTOM_LLM_ENDPOINTS.
Adding or updating an endpoint here immediately syncs DEFAULT_MODEL to
match, without an extra confirmation, whenever DEFAULT_MODEL is unset or
already points at that endpoint. The same paginated, searchable model picker
backs model selection in notewise setup, this DEFAULT_MODEL category, and
notewise inference add|update — type a number, search text, n/p to page,
or press the Left/Right arrow keys to jump pages instantly without pressing
Enter. edit-config
opens the current settings as an editable env-style file in your $EDITOR, then
re-saves whatever you leave in it — including removing lines you delete.