Skip to main content
Use rctl, Routr’s command-line tool, to manage Connect resources: Agents, Domains, Peers, Trunks, Numbers, Credentials, and ACLs. It talks to the API Server on port 51908.

Prerequisites

  • Node.js and npm.
  • A running Routr server with a database-backed API Server, such as routr-one or the Helm chart. The file-based simpledata API Server is configured through YAML files instead.
  • Network access to the API Server’s port 51908. On Kubernetes, use kubectl port-forward. See Deploy on Kubernetes.

Install rctl

Install the package globally.
Confirm the installation by printing the version.

Connect to the server

Every command accepts the same three connection flags. There is no login step or saved profile, so pass the flags on each command. Pick the form that matches how the API Server is configured.
routr-one runs the API Server without TLS by default (TLS_ON=false). Add --insecure.
To shorten commands, define a shell alias, for example alias rctl='rctl --insecure' for a local test server.

Work with resources

Commands follow a rctl <resource> <verb> pattern. The resources are acl, agents, credentials, domains, numbers, peers, and trunks. Each one supports create, get, describe, update, and delete. The examples below use --insecure and Agents.
1

Create a resource

create is interactive. It prompts for each field and lists existing resources, such as Domains and Credentials, to choose from. Create the Domain and Credentials before the Agent that uses them.
The value at the end is the new resource’s ref. Other commands use it.
2

List resources

get prints a paginated table. Use --size to change the page size (default 50) and --extended for more columns. Pass a ref to show one item.
3

Show the details of a resource

describe prints every field of one resource, including linked resources such as the Agent’s Domain and Credentials.
4

Update a resource

update takes the ref and prompts for the fields you can change, prefilled with the current values. Some fields, such as an Agent’s username, can’t be changed after creation.
5

Delete a resource

delete requires the ref and runs without a confirmation prompt.

Pitfalls

  • Creating a resource that references a missing one. Create Credentials and Domains before Agents, ACLs before the Domains or Trunks that use them, and Trunks before Numbers.
  • This Agent already exist. A resource with the same unique field, such as a username, already exists. Use update or pick another value.
  • Connection errors. Check --endpoint, then check that the TLS flag matches the server: --insecure for TLS off, --cacert for a self-signed certificate.
  • Scripting. create and update are interactive. To automate changes, use the Node.js SDK.

Extend rctl

rctl supports oclif plugins through rctl plugins:install. To add your own commands, see Extend rctl. For shell completion, run rctl autocomplete.

rctl reference

Every command, argument, and flag.

Connect resources

What each resource represents and its fields.