Authentication

Most translation and export functionality is local and does not require you to be logged into Curvenote. Additionally, the API for any public content on Curvenote does not require you to be authenticated. However, to deploy a site, push a work or submit to a venue you need to be signed in.

The Curvenote CLI signs in with an API token, which you make in your settings on the Curvenote SCMS at scms.curvenote.com. Sign in there first, with the account you will use the CLI as.

Creating an API Token

An API token lets the CLI, a script or CI act as you. It can do anything your account can, so give it an expiry and keep it secret.

🛠️ Open Settings › API tokens from your account menu. The page lists your tokens, with when each was created, last used and expires, and has a Create token button.

Your API tokens in Settings, with when each one was last used and when it expires, so you can see at a glance which tokens are still in use.

Figure 1:Your API tokens in Settings, with when each one was last used and when it expires, so you can see at a glance which tokens are still in use.

🛠️ Select Create token, give the token a name you will recognize later (for example, where it will be used), and pick when it expires. Names must be unique, and 90 days is the default.

Name the token after where it will be used, and choose when it expires.

Figure 2:Name the token after where it will be used, and choose when it expires.

🛠️ Copy the token. This is the only time you will see it, so copy it now and keep it somewhere safe, like a password manager or your CI’s secrets. Don’t paste it into an AI agent or chat; set it up yourself with the CLI (below) and let the agent use the CLI.

The token is shown once, when you create it: copy it before you close the dialog.

Figure 3:The token is shown once, when you create it: copy it before you close the dialog.

Sign In to Curvenote using the CLI

🛠️ Sign into the Curvenote CLI using the command:

curvenote token set

You will be asked for the API token you copied from Settings › API tokens (see above). The command will store a local config file that has your API token to be used for future calls to the library.

Validate you are signed in

🛠️ You can validate that you are signed in using the command:

curvenote auth list

This will print your username and email or tell you that you are not authenticated. This command will also list any other accounts that you can login as.

Changing Profiles

If you have multiple Curvenote accounts, for example, as a bot for a submission system, you can switch profiles using:

curvenote token select

This will bring up a prompt to select which account you should use for the Curvenote API.

Authenticating on a Server

You can also override the config path by having a CURVENOTE_TOKEN in your environment, this is helpful when using the Curvenote CLI from a continuous integration system or on a server.

export CURVENOTE_TOKEN="API_TOKEN"
CURVENOTE_TOKEN environment variable takes priority

If the environment variable is present, it will have precedence over any token you have set previously. The CLI will notify you through a log message about which token is being used.

Alternatively, you can use the curvenote token set $ENV_VAR to set the token programmatically; we recommend not to paste your token into the command line directly as that will create an entry in your terminal history.

Sign Out of Curvenote

Every token subcommand is listed in curvenote token. To sign out of the Curvenote CLI, you can call:

curvenote token delete

This will remove the local config file with the API token in it. Note, if you have signed into the CLI using the environment variable, you can unset that using unset CURVENOTE_TOKEN. To confirm that you are logged out you can run the command curvenote auth list as before, and it should inform you that you are not authenticated.

Abbreviations
API
Application Programming Interface
CLI
Command Line Interface
SCMS
Scientific Content Management System