CLI reference¶
tiroir is administered with one command, tiroir, that ships inside the
server's image. In version 0.1.0 it holds the administration CLI,
tiroir admin, which you run in the server's container from the directory of
the stack:
It works directly on the server's data, so it needs no token: shell access to the container is the administrator's credential. A change to members or access takes effect at the members' next request.
Every command accepts -h or --help, which prints its usage. The examples
below leave out the docker compose exec tiroir prefix.
Coming later
A member CLI, run on a member's own machine against the server (search, read, log, proposals), and the administration commands for embeddings, mirrors, evaluation, backups and the server's state are planned for later releases. They are not in 0.1.0, and this page will document them when they are.
tiroir¶
| Option | Meaning |
|---|---|
--version |
Print the version, for example 0.1.0, and exit. |
tiroir admin init¶
Creates the first administrator, handle admin, and prints its initial
password once. The administrator chooses a new password at the first sign-in.
The command refuses to run on a server that already has an administrator.
On a new server, it first prints the steps that set up the server's database.
$ tiroir admin init
server database migrated to version 1
…
member created: …
administrator: admin
initial password (shown once, to change at first sign-in): …
tiroir admin members¶
Lists and changes the server's members. Without an action, it lists them.
members list¶
Prints one member per line: handle, display name, and [admin] or
[disabled] when they apply.
members add¶
| Argument | Meaning |
|---|---|
handle |
The member's sign-in name: lowercase letters, digits, - and _. |
--name NAME |
The display name. Required. |
--admin |
Make the member an administrator. |
Creates the member and prints an initial password once, to change at the first sign-in.
$ tiroir admin members add alice --name Alice
member created: …
member: alice
initial password (shown once, to change at first sign-in): …
members disable¶
Disables the member and removes their access to every store: they can no longer sign in. The handle stays reserved.
members reset-password¶
Gives the member a new password, printed once, to change at their next sign-in.
$ tiroir admin members reset-password alice
member password reset: …
alice: new password (shown once, to change at next sign-in)
…
tiroir admin stores¶
Lists and creates stores. Without an action, it lists them.
stores list¶
Prints one store per line: name, audience, language, and the number of members with access to it.
stores add¶
usage: tiroir admin stores add [-h] --audience {personal,team}
--language LANGUAGE [--owner OWNER]
[--preset PRESET]
name
| Argument | Meaning |
|---|---|
name |
The store's name, a lowercase slug such as alice-memory. |
--audience {personal,team} |
personal: one member's memory. team: shared by the members you grant. Required. |
--language LANGUAGE |
The language of the store's content, such as fr or en. Required. |
--owner OWNER |
The handle of the member who owns the store. They get write access, and the store becomes their default. Required for a personal store. |
--preset PRESET |
The preset the store starts from. In 0.1.0, every store starts from a preset, and the only one is accounting-firm, filled with invented client drawers. |
Creates the store and indexes it.
$ tiroir admin stores add alice-memory --audience personal --language fr \
--owner alice --preset accounting-firm
store: alice-memory
tiroir admin grant¶
| Argument | Meaning |
|---|---|
handle |
The member. |
store |
The store's name. |
{read,write} |
The access to give. Granting again replaces the previous access. |
A personal store has its owner only: granting it to another member is refused.
tiroir admin revoke¶
Removes the member's access to the store. Revoking an access the member does not have is not an error.
tiroir admin index¶
| Option | Meaning |
|---|---|
--store STORE |
Index this store only. Without it, every store. |
--rebuild |
Rebuild the index from scratch instead of bringing it up to date. |
Indexes are brought up to date when a store is created and after each write, so this is rarely needed. It prints, per store, the files it indexed (none when the index was already up to date) and the chunks the index holds.
$ tiroir admin index --store alice-memory
alice-memory: 0 files indexed, 399 chunks
$ tiroir admin index --rebuild
alice-memory: 247 files indexed, 399 chunks
team-memory: 247 files indexed, 399 chunks
tiroir admin serve¶
Runs the server on port 8080. It is the image's entry point, which Compose starts for you; you do not run it by hand.
Exit codes¶
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
The operation failed, for example an unknown member or a store name already used. The reason is on stderr. |
2 |
Usage error: an unknown command or option, or a missing argument. The usage is on stderr. |
3 |
Refused by an access rule, for example granting a personal store to a second member. |
5 |
The store is busy; try again. |