---
title: "How to add your email signature to email a script or local agent sends"
url: https://signatoro.com/blog/email-signature-command-line-agents
description: "An agent or script on your own computer sends email without your signature. One command, npx signatoro get, prints your saved signature for Claude Code, Codex, OpenClaw or a cron job to append. Setup, the rule to paste, and what each exit code means."
published: 2026-11-08
updated: 2026-11-08
---

# How to add your email signature to email a script or local agent sends

An agent or script on your own computer sends email without your signature. One command, npx signatoro get, prints your saved signature for Claude Code, Codex, OpenClaw or a cron job to append. Setup, the rule to paste, and what each exit code means.

Run `npx signatoro get` before the email goes out, and append what it prints after the body. The command prints the signature you saved on Signatoro, the agentic email signature platform, so a script, a cron job or an agent with a shell, such as Claude Code, Codex or OpenClaw, signs its email the way you do. You need a Signatoro API key and Node.js 18 or later.

Gmail and Outlook add your signature in their own compose windows. Email sent from code, through the Gmail API, an email API or SMTP, ends where the code's text ends. The post on [why emails your AI agent sends have no signature](https://signatoro.com/blog/ai-agent-email-no-signature) covers that gap for each AI tool.

## What the command does

The `signatoro` package went on npm on October 15, 2026 (version 0.1.0, MIT license, no dependencies). It calls Signatoro's API with your key and prints the result:

| Command | Prints |
| --- | --- |
| `signatoro get` | the signature as plain text |
| `signatoro get --html` | the signature as HTML, for an HTML body |
| `signatoro get --json` | the full API response, with `sender` |
| `signatoro get --short` | name, role line and one link |
| `signatoro get --signature Ada` | the signature of your AI assistant named Ada |

The signature goes to standard output and every message goes to standard error, so `signatoro get --html > sig.html` writes a file holding the signature and nothing else.

`--json` adds `sender`: your name, title, company, phone, email, links and address as separate fields. An agent that writes "call me on..." in the body takes the saved number from there.

## Set it up

1. **Save your signature.** Make it in [Signatoro's generator](https://signatoro.com/free-email-signature-generator) and sign up, or open your signature page if you have one.
2. **Make an API key.** On the [Connect page](https://signatoro.com/home/connect?tab=api), under "For tools and assistants", click "Generate API key". Copy it; it is shown once.
3. **Give the key to the command.** Either run `signatoro login`, which asks for the key with the typing hidden and saves it to `~/.config/signatoro/config.json`, readable only by you, or set it in the environment:

   ```sh
   export SIGNATORO_API_KEY=sig_live_...
   ```

   The environment variable wins when both are set. `signatoro login` checks the key with one request.
4. **Test it.** Run `npx signatoro get`. Your signature prints. To skip the download on every run, install it once with `npm install -g signatoro`.

Keep the key in the environment the agent runs in, never in a prompt or a chat message. The command never prints a key; its messages show it masked.

## Tell the agent to use it

An agent adds the signature when its instructions say so. Paste a rule into the file the agent reads at the start of every session:

- **Claude Code** reads `CLAUDE.md`: `~/.claude/CLAUDE.md` for every project, `./CLAUDE.md` for one. It can also read a repository's `AGENTS.md`.
- **Codex** reads `AGENTS.md` in `~/.codex`, then in each folder from the project root down to where it runs.
- **OpenClaw** loads `AGENTS.md` from its workspace at the start of every session. Set `SIGNATORO_API_KEY` in the environment the gateway runs in.

The rule, from the package's own instructions:

```md
## Email signature

Before you send, reply to, forward or draft any email, run
`signatoro get --html` and append its output after the body, after a
blank line, as printed. For a plain-text email, use `signatoro get`
instead.

- Run it for every email; do not cache it.
- Do not write your own sign-off or signature block.
- For my name, title, phone, email or links in the body, use only the
  values in `signatoro get --json`'s `sender`. If one is missing, leave
  it out and tell me - never guess.
- Exit code 2: stop and tell me. Exit code 3, 4 or 5: send without a
  signature and tell me.
- Never print SIGNATORO_API_KEY.
```

"Do not cache it" is what keeps the signature current: you change your title on Signatoro, and the next email carries the new one.

## Let the sending code carry the signature

The safest setup has the sending code read the signature itself. A script that writes `signatoro get --html > sig.html` and attaches that file to the message body never passes the signature through the agent's own text. That matters: on October 18, 2026, an agent fetched the right signature, retyped it into its Gmail tool call, and nine emails went out with "[REDACTED]" where the email address belonged. The post on [the redacted signature](https://signatoro.com/blog/ai-agent-email-signature-redacted) has the details. Read one sent email back before you trust a new setup.

For the sending step itself, the guides cover the [Gmail API](https://signatoro.com/docs/install-signature/agent/gmail-api) and [email APIs such as Resend and Postmark](https://signatoro.com/docs/install-signature/agent/email-apis).

## Each exit code tells the agent what to do

The command exits with a code the agent can act on:

| Code | Meaning | What the agent does |
| --- | --- | --- |
| 0 | Worked | Append the output and send |
| 1 | Wrong command, or `--signature` named no signature this key has | Fix the command; the message lists the names |
| 2 | No key, or the key is wrong, replaced or revoked | Stop and tell you |
| 3 | The free month's requests are used up, or too many at once | Send without a signature and tell you |
| 4 | Network or server error | Retry, or send without one and tell you |
| 5 | No signature saved yet | Send without one; never invent one |

Code 2 after you made a new key is expected: each account has one live API key, and making a new one retires the old one. The Connect page warns before it does.

## One agent, its own signature

When an agent should sign as itself, with its own name and a line saying it is an AI working for you, add it as an AI assistant on the Connect page and click "Generate key for" its name. That key always returns the assistant's signature, so each agent gets its own key in its own environment and runs the same `signatoro get`. With your own key, `--signature <name>` picks one of your assistants. The post on [a signature for each AI agent](https://signatoro.com/blog/signature-per-ai-agent) covers when to sign as yourself and when as the agent.

## When to use the MCP server instead

Use the command when the agent or script has a shell on your machine and no MCP client, or when you want the signature in a file that code reads. Use Signatoro's MCP server when the agent already connects to MCP servers: the page on [email signatures for coding agents](https://signatoro.com/coding-agents-email-signature) has the setup for Claude Code, Cursor, Codex and the rest. Both return the same saved signature, and both are on the Free plan.

## Questions

### Does it cost anything?

The command is free. Free accounts get a set number of signature requests a month, and each `signatoro get` counts as one. Company plans have no monthly cap. The [pricing page](https://signatoro.com/pricing) has the numbers.

### Can it list my signatures?

The command has no `list`. Run `signatoro get --signature` with any name: when nothing matches, it prints the names that do. Your AI assistants are also listed on the Connect page.

### Does it work on Windows?

Yes, with Node.js 18 or later. `signatoro login` saves the key to `%APPDATA%\signatoro\config.json`.

### Will Gmail add my signature on top?

No. An email sent through the Gmail API goes out as the code built it, so the signature from `signatoro get` is the only one.

### Can I run it on a server?

Yes. Set `SIGNATORO_API_KEY` on the server and call the command, or call the API directly; the [API guide](https://signatoro.com/docs/install-signature/agent) has the request.

## Sources

Read on November 2, 2026:

- [signatoro on npm](https://www.npmjs.com/package/signatoro) (version and publish date from the npm registry)
- [How Claude remembers your project (Claude Code docs)](https://code.claude.com/docs/en/memory)
- [AGENTS.md (Codex docs)](https://learn.chatgpt.com/docs/agent-configuration/agents-md)
- [Agent workspace (OpenClaw docs)](https://docs.openclaw.ai/concepts/agent-workspace)
