gancio-upstream/docs/usage/cli.md

62 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2023-06-30 23:44:35 +02:00
---
layout: default
title: CLI
permalink: /usage/cli
nav_order: 2
parent: Usage
has_toc: true
---
# CLI - Command Line Interface
{: .no_toc }
1. TOC
{:toc}
## Using CLI
Gancio is distributed with an embedded CLI.
To use the CLI you need to specify the `config.json` configuration file via `--config <your_config.json>` flag; by default the CLI will look for one in the current directory, so if your current directory is /opt/gancio (having followed the [installation instructions](/install/debian)) there is no need to specify it.
2023-06-30 23:48:17 +02:00
### Using CLI with Docker installation
2023-06-30 23:44:35 +02:00
To use the CLI in a docker installation you can execute a shell inside the container with:
`docker exec --workdir /home/node/data -it gancio sh` and following the normal CLI usage or running commands with:
`docker exec --workdir /home/node/data gancio gancio <your command>`
(the first "gancio" is the container name)
2023-06-30 23:48:17 +02:00
## Users <span class='label label-yellow'>since 1.6.14</span>
2023-06-30 23:44:35 +02:00
All users related sub-commands starts with `gancio users`.
Note that most of this actions could be done from administration panel (Admin > Users).
### List all users
To list all users use
`gancio users list`
### Create a new user
2024-04-04 22:29:21 +02:00
`gancio users create <username|email> [password] [role]`
2023-06-30 23:44:35 +02:00
2024-04-04 22:29:21 +02:00
`role` value could be `user` (default), `admin` or `editor`, you can also specify it using `--role` flag.
To create an user with administrator privileges use the `--role` flag, e.g. `gancio users create admin@example.com --role admin`
2023-06-30 23:44:35 +02:00
### Remove a user
`gancio users remove <username|email>`
### Reset password
`gancio users reset-password <username|email>`
2024-04-04 22:29:21 +02:00
### Change role
2023-06-30 23:44:35 +02:00
To add administrator privileges to an user:
2024-04-04 22:29:21 +02:00
`gancio users set_role <username|email> admin`
2023-06-30 23:44:35 +02:00
To remove administrator privileges from an user:
2024-04-04 22:29:21 +02:00
`gancio users set_role <username|email> user`