gligabao is also a client: remember, query, dataset, research, api, status and stop let an agent (or a person) use gligabao from the command line, without writing HTTP calls. The commands are thin: each one builds the JSON body of the matching REST endpoint, sends it and prints the response, so fields, validation and errors are exactly those of the API (remember, query, datasets). The commands live in the public cli package (cli/commands.go), so a program that embeds gligabao with cli.New gets them too (its own serve, with its hooks, is what the CLI starts as the local daemon).
The local daemon
The commands always talk to a server. By default that is a local daemon:gligabao serve --host 127.0.0.1 of this same binary, which the first command starts in the background (its own session, so it outlives the terminal) when nothing answers on the port. If a gligabao server already answers there, the command uses it and starts nothing. So there is one process on the database, however many agents call the CLI at once, and the remember manager still runs one remember at a time.
- Port:
portof the config (default 7878). If another program holds it, the command fails and tells so. - No authentication: the daemon listens on
127.0.0.1only (serve --host, orhostin the config), and the CLI sends no API key to it. - Keys: the daemon is a normal server, so it needs
ANTHROPIC_API_KEYandOPENAI_API_KEY(environment or config). If it cannot start, the command exits with code 5 and prints the end of the daemon’s log. - Files: the log is
daemon-<port>.logand the piddaemon-<port>.pid, in~/.gligabao(GLIGABAO_HOMEchanges the directory).gligabao stopshuts the daemon down (the next command starts it again);gligabao statusshows whether it runs, without starting it.
Where the config and the data are
- If the current directory has a
gligabao.toml, or--configis given, the daemon runs asgligabao servewould: that config and the default paths ofserve(build/gligabao.db, relative to the directory). - Otherwise it uses a stable directory, so an agent gets the same memory whatever directory it runs in:
~/.gligabao/gligabao.tomlif it exists (else the defaults) and the database~/.gligabao/gligabao.db(the vectors and images next to it).
Another server
--server URL (or GLIGABAO_URL) sends the commands to that server instead; nothing is started, and GLIGABAO_API_KEY is sent as Authorization: Bearer. (Remote servers as targets are not finished: how the CLI authenticates to them is still to be designed.)
Commands
--user (env GLIGABAO_USER, default local_user: the user_id of every request), --server, --config.
remembertakes the text as an argument, from--file, or from stdin with-;--imageremembers an image instead. The flags map to the request fields (--atisreference_time,--seriesistimeseries.series,--modeland--reasoningaremodelsandreasoning, repeatable asSTAGE=VALUE).--json(onrememberandquery) is the whole request body as JSON text,@fileor-(stdin), so the exact REST body can be passed and a new request field never needs a new flag. The flags that are given override its fields;user_iddefaults to--useronly if the body has none.query --evidence-onlyis a retrieval-only call, see Query.query --rawprints just the answer, as text.researchstarts and follows research agents:startprints the run right away (-dpicks the dataset of your knowledge base the agent queries and remembers into,mainby default) (the agent goes on in the background, it costs money),--waitwaits for it to end and prints the finished run (exit code 1 if it failed;--rawprints only the report),ls --activelists the agents that are working, andget IDshows a run with every state it went through (--raw: only the report).apisends the request as it is (it adds nouser_id), for what has no command.
Output and exit codes
The response of the server is printed to stdout as indented JSON. An error is printed to stderr as{"error": "...", "status": 404} (status is the HTTP status, if there was one), and the exit code says what kind it is:
Not covered
Training, evals, the sidecar and the admin API are not commands (they need the sidecar and long-running event streams); useapi for the plain request/response ones, or the server’s endpoints. Forgetting a single artifact or fact, and reading the status of a run, are not available yet.