Change and publish an agent with the Newo CLI

Change how an agent behaves from your own machine: edit an attribute, a skill, or the knowledge base, review exactly what changed, and decide when it goes live. On a Flow Designer V2 account, changes to project files don't reach your customers until you publish.

Before you begin

Choose the smallest change

Most behavior changes don't need code. Work down this list and stop at the first one that fits:

  1. An attribute: for a setting such as business details, hours, phone numbers, feature switches, or a prompt text kept in an attribute. Intents, scenarios, and procedures are attributes too.
  2. The knowledge base: when the agent lacks facts, such as a menu, prices, or policies.
  3. Code in the account's own project: when neither of the above is enough.

Changing the code of a framework or extension project is a last resort. See Framework and extension projects.

Change an attribute

  1. Run newo profile and check that it names the account you mean to change.
  2. Run newo pull-attributes to save the current values under newo_customers/. You need the old value to undo the change.
  3. Update the attribute:
newo update-attribute [attribute_idn] --value "[value]"                           # a customer attribute
newo update-attribute [attribute_idn] --project [project_idn] --value "[value]"   # a project attribute
newo update-attribute [attribute_idn] --file ./value.txt                          # a long or multi-line value

The change is live as soon as the command succeeds. The command keeps the attribute's title, description, and allowed values, and masks a secret value in its output.

Attribute values are strings, so a switch is "True" or "False". For how attributes work, see Attributes system.

:::
Important

On a Flow Designer V2 account, the next publish resets a live project attribute to the value in the project files. To keep a value, change it in the project files too.
:::

Change skill code

These steps apply to a Flow Designer V2 account. After the first newo pull, such an account has a projects_v2/ folder, and newo status prints Designer: Flow Designer V2. If you get a projects/ folder instead, see Legacy Flow Designer accounts.

  1. Run newo pull. The CLI mirrors the version each project runs into newo_customers/[customer_idn]/projects_v2/[project_idn]/.
  2. Edit the files. A project is a set of YAML files that declare its agents, flows, skills, events, state fields, and project attributes, plus one code file per skill.
  3. Run newo lint to check the skill files offline.
  4. Run newo status to list what you changed, or newo diff --detailed to compare the content with the platform.
  5. Run newo push. The CLI writes your project changes to a pending version. Agents keep running the active version.
  6. Run newo publish. The CLI lists the live project attributes that activation overwrites, adds, or deletes. When anything would be overwritten or deleted, it asks you to confirm. The pending version then becomes the active one.

Customer attributes work differently. An edit to the customer attributes.yaml goes live as soon as you push, because customer attributes aren't part of a project version.

A pulled project usually looks like this. The exact paths come from the project version: project.yaml is the root, and each skill's execution_path names its code file. With a browser login, the customer folder is named after the customer IDN. With a single NEWO_API_KEY, it's named default.

newo_customers/[customer_idn]/
├── attributes.yaml                  # customer attributes
└── projects_v2/[project_idn]/
    ├── project.yaml                 # root file; lists the files it includes
    └── agents/[agent_idn]/
        ├── agent.yaml
        └── flows/[flow_idn]/
            ├── flow.yaml
            └── skills/[skill_idn].nsl

Keep the file extension that newo pull wrote. A skill's language has to match its runner type: .nsl for the Newo Script Language and .nslg for Guidance. Some projects are written in Python instead, and a project never mixes the two, so write in the language the project already uses. See Skill scripts and the Newo Script Language.

Wait about two minutes after you publish before you test. The first conversations can still run the previous version.

:::
Warning

Publishing replaces the live project attributes with the version's attributes. Values are overwritten, and live attributes that the version doesn't declare are deleted. Read the list newo publish prints before you confirm.
:::

What stops a push or a publish

The CLI stops instead of overwriting someone else's work:

  • Another version became active since your pull: newo push stops. Pull again. The CLI keeps your local edits and warns about any file that changed on both sides.
  • A file changed in the pending version since your pull: newo push stops. Save your edits elsewhere, run newo pull --force, then apply them again. --force replaces every local file that differs from the platform, including edits you haven't pushed.
  • Another version became active after your pending version was created: newo publish skips that project. Review the active version in the Builder and reapply your edits on top of it.
  • A project has local changes you haven't pushed: newo publish doesn't publish that project. Push first.
  • An item fails to upload: newo push continues with the rest, lists the failures, and exits with code 1. Fix them and push again. Only the failed items are sent.

newo push --force and newo publish --force override these version checks. Use them only when you know which changes you're dropping.

Framework and extension projects

Most accounts run a framework project installed from a registry, such as NAF, next to the account's own projects. A framework or extension project is shared code, so an edit to it doesn't behave like an edit to your own project: a project that runs a registry module keeps running the module, and your edit doesn't take effect even when published.

For that reason, newo push, newo watch, and newo update-skill ask before they change the code of NAF, NAC, Outbound, Lead Nurturing, Food Order, or another framework or extension. Without a terminal, they stop.

  • Customize through attributes and the knowledge base: a push that changes only a framework project's attributes goes through without asking.
  • Change the code only on purpose: add --unrestricted to the command. --yes doesn't turn this on, so a script that answers yes to everything can't change shared code by accident.

Integrations and the account's own projects never ask.

Update the knowledge base

newo pull-akb     # download articles into newo_customers/[customer_idn]/akb/
newo push-akb     # import the articles in those files

newo push-akb creates articles. It never updates or deletes existing ones, and it doesn't compare your files with the platform, so pushing files you pulled duplicates every article.

To add articles, run newo push-akb from a folder whose akb/ files hold only the new ones. Edit existing articles in the Builder. For how the knowledge base works, see Active Knowledge Base.

Legacy Flow Designer accounts

The CLI detects which Flow Designer an account uses and picks the matching behavior. On a legacy account:

  • newo pull writes each project to newo_customers/[customer_idn]/projects/.
  • newo push uploads your changes and publishes the changed flows straight away. Add --no-publish to upload without publishing.
  • newo publish isn't available.

The other way round never happens: on a Flow Designer V2 account, the CLI refuses any change through the legacy Flow Designer, because such a change would never reach the agents.

Legacy Flow Designer support is deprecated since CLI version 5.0, and a future major version removes it.


Did this page help you?