Set up the Newo CLI with an AI coding assistant
Connect an AI coding assistant to a Newo account so it can inspect, test, and change your agents for you. One prompt starts the setup. The assistant installs what's missing, opens a browser window for you to sign in, and leads you through the rest.
For step-by-step setup in a specific app, see Run the Newo CLI with Claude or ChatGPT.
Before you begin
- An AI coding assistant: Claude Code, Codex, or Gemini CLI. The CLI writes its instructions in the formats these three read.
- Which account to work on, if your login manages several. The CLI lists them by organization name and customer IDN, for example
NEWO_ABC123, so you only need to recognize the right one. Ask whoever manages the account if you're not sure. - A Newo login that can manage the account: your role on the account must be owner, co-owner, technical owner, or technical support. Viewers, contractors, and accounts with a signed BAA use an API key instead (see Use an API key instead).
- Node.js 22.12 or later: the assistant installs it if it's missing. npm comes with Node.js.
:::
Important
Conversations and logs hold your customers' personal data. Use an assistant that your organization allows for that data.
:::
Start the setup
- Create an empty folder and open your assistant in it.
- Paste this prompt and press Enter:
Install the Newo CLI (https://www.npmjs.com/package/newo) and set it up in this folder; install
Node.js and npm first if they are missing. Then help me sign in to my Newo account through the
browser, let me choose which account to work with, and tell me briefly what you can do in it. Keep
it simple: one step at a time, and give me buttons to choose from instead of asking me to type.The assistant asks before each step. It installs Node.js if needed, installs the CLI, and runs newo init, which adds these files to the folder:
| File | Purpose |
|---|---|
AGENTS.md | How the platform fits together, and the rules the assistant follows on every task. |
CLAUDE.md, GEMINI.md | One line each that points Claude Code and Gemini CLI to AGENTS.md. |
.claude/skills/, .agents/skills/ | The five skills, for Claude Code and for Codex and Gemini CLI. |
.env | Where the CLI saves the account this folder works on (NEWO_DEFAULT_CUSTOMER), and an API key if you ever need one. Readable only by you. |
.gitignore | Keeps .env, cached tokens, downloaded conversations, and downloaded account data out of git. |
adk/ | Newo's Agent Development Kit, a read-only copy of its playbooks, setting reference, and delivery skills. See Newo CLI. |
newo init needs no sign-in, apart from the network for the adk/ download, and keeps files that already exist. It never replaces an existing .env, and it only adds the lines an existing .gitignore lacks.
Sign in
- The assistant runs
newo auth status. It works offline and says whether you're signed in and what to do next. - It tells you a browser window is about to open, then runs
newo login. - Sign in to Newo in that window. If no window opens, open the link the assistant shows you. The login waits up to five minutes.
- The first time, an Authorize App screen asks you to let Newo CLI access your account. Click Accept.
- The browser shows You are signed in, and you can close the tab. The CLI prints
Logged in.
The browser returns to the CLI on your own computer, on port 8766, 8767, or 8768, whichever is free. The session is saved in ~/.config/newo-cli/session.json, readable only by you. It isn't stored in the project folder, so it never ends up in git or in the chat. newo logout revokes the session and deletes the file.
:::
Note
If your assistant runs commands in a sandbox, as Codex does by default, the sandbox must allow the network, the local port, and writes to ~/.config/newo-cli. The CLI renews the session in that folder from time to time. Run the Newo CLI with Claude or ChatGPT has the Codex settings. Otherwise, run newo login in your own terminal and tell the assistant when it's done.
:::
Choose the account
A login can reach every account you manage, so the CLI needs to know which one this folder works on.
- The assistant runs
newo customers. It lists the accounts your login can open from the CLI, each with its organization name and customer IDN. With one account, the assistant uses it. - With several, choose the one this folder works on.
- The assistant runs
newo customer switch [customer_idn]. It checks that your login can open the account, then savesNEWO_DEFAULT_CUSTOMER=[customer_idn]in the folder's.env.
If the list is empty, the account may be on the EU platform (see Use an EU account), or your login can't open any account from the CLI (see Use an API key instead). Where the platform can't list accounts yet, the assistant asks for the customer IDN instead. Many IDNs look like C_NE_ followed by letters and digits.
In a terminal, newo login offers the same list as soon as you've signed in, and newo customer switch without an IDN lets you pick from it with the arrow keys.
Commands in this folder now work on that account without --customer. To work on another account for one command, add --customer [customer_idn] to it.
Confirm the connection
The assistant runs newo profile, which prints the organization name and the customer IDN it reached. Check that it's the account you expect.
The assistant then tells you briefly what it can and can't do in the account, and suggests a few first tasks, such as showing the last five conversations. From here, ask for what you need in plain language.
Set up the CLI without an assistant
To use the CLI from a terminal on its own:
npm install -g newo@latest
newo --version
newo login
newo customer switch
newo profileRun newo with no arguments at any time to see the setup steps and which ones are done. newo auth status shows whether you're signed in, for which account, and the one next step.
Work with several accounts
With a browser login, you don't need anything extra:
newo customerslists the accounts your login can open, and marks the folder's default.newo customer switch [customer_idn]sets the default account for the current folder. Use a separate folder for each account to keep their files apart.--customer [customer_idn]on a command picks an account for that command only.- A
NEWO_DEFAULT_CUSTOMERset in your shell wins over the one in.env.newo customer switchtells you when that happens.
Use an EU account
EU accounts live on https://app.eu.newo.ai. Sign in there:
newo login euLater commands use the EU platform by themselves, so you don't set anything else. One computer holds one login: newo login eu replaces a US login, and newo login us switches back.
A NEWO_BASE_URL set in the shell or in .env still wins over the login. When it names a different platform from your login, commands stop and say so: remove or fix NEWO_BASE_URL, or sign in again for that platform. With an API key, set NEWO_BASE_URL=https://app.eu.newo.ai in .env for an EU account.
Use an API key instead
Use an API key only when browser login is refused for your account, or for automation that has no browser, such as a CI job. API key sign-in is deprecated and will be removed: every command that uses a key prints a warning. While a key is set, the browser login isn't used.
- Sign in at app.newo.ai, choose the account, and open the Builder.
- Go to Integrations and open API Integration.
- Create a Connector. Any name works, for example
newo-cli. - Save the connector, then open it again. The API key appears only after you save.
- Copy the key and give it to the CLI:
- If the assistant shows a field for the key: paste the key there and press Enter. The key is saved to
.envwithout passing through the chat, and the assistant learns only which account it opens. - If it doesn't: paste the key after
NEWO_API_KEY=in the.envfile, at the path the assistant gives you.
- If the assistant shows a field for the key: paste the key there and press Enter. The key is saved to
One key opens one account. With a single NEWO_API_KEY, the CLI names the account default, and downloaded files go to newo_customers/default/. For several accounts, list one key per account with NEWO_API_KEYS=["first_key","second_key"] and pick one with --customer [customer_idn]. newo customers shows the accounts the keys open.
The name .env starts with a dot, so Finder and File Explorer hide the file. Open it in your code editor, or turn on hidden files.
:::
Important
Never paste the API key into the chat. If you did, delete that connector in the Builder and create a new one.
:::
Fix setup problems
| Symptom | What to do |
|---|---|
The assistant can't find node right after installing it | Quit and reopen the assistant app, then open the folder again. |
npm install -g newo fails with EACCES on macOS or Linux | Don't use sudo. Run npm config set prefix ~/.npm-global, add ~/.npm-global/bin to PATH in your shell profile, reopen the terminal or app, and install again. |
Not signed in or Authentication required | Run newo login. With an API key, the .env file is missing or in another folder: run newo from the folder that holds it. |
No customer selected | Run newo customer switch [customer_idn], or add --customer [customer_idn] to the command. |
Your browser login is for [url], but NEWO_BASE_URL ... is [url] | The login was made for another platform. Do the step the message prints: remove or fix NEWO_BASE_URL in the shell or .env, or sign in again for that platform with newo login eu or newo login us. |
newo customers lists no accounts | The account may be on the EU platform: run newo login eu. Otherwise your login can't open any account from the CLI. Use an API key. |
Your account has no access to customer [customer_idn] | Check the IDN, and that you signed in with the login that is a member of that account. Access through support or admin tools doesn't count. Otherwise use an API key. |
| Browser login refused for the account | Your role on the account doesn't allow it, or the account has a signed BAA. Use an API key. |
Timed out after 300s waiting for the browser login | Run newo login again and finish signing in within five minutes. |
A command stops with must not be used and an update command | This CLI version was found unsafe. Run npm install --global newo@latest, then try again. |
AUTH_FAILED, or HTTP 400 or 401, with an API key | The key is wrong or was deleted. Create a new connector and use its key. |
newo profile shows a different account | An old token is cached. Delete the tokens.json files under .newo/ and run newo profile again. Keep the rest of .newo/: it records what you pulled. |
Unknown customer with a single API key | Leave out --customer, or pass --customer default. |
Updated about 16 hours ago