ntasks
v0.5.0
Published
Deploy Ntasks, the task list you share with your AI agents, to your own Cloudflare account, and update it: npx ntasks deploy.
Maintainers
Readme
ntasks
npx ntasks deploy deploys Ntasks, the
task list you share with your AI agents, to your own Cloudflare account. Run
it again to update that deployment to the latest release.
npx ntasks deployIt needs Node.js 22 or later and a Cloudflare account. No copy of the Ntasks repository is involved: this package holds the built Worker, the web app and the D1 migrations, and deploys them with wrangler.
What it does
The first run:
- Opens Cloudflare's login in your browser (
wrangler login). It skips this when wrangler is logged in already orCLOUDFLARE_API_TOKENis set. - Creates a D1 database named
ntasks, or uses the one of that name the account already has, as after a first run that stopped.--dry-runnames the database first; when it is not Ntasks's, choose another name with--name. - Applies the D1 migrations the database lacks.
- Makes an
AUTH_SECRETand deploys a Worker namedntaskswith it. - Prints the Worker's address and the setup steps: open
/sign-in, enter theAUTH_SECRETit printed and choose Create the GitHub App. Keep a copy ofAUTH_SECRET; the command shows it only on this run.
A later run finds the Worker in the account by name and keeps the D1 database the Worker is bound to, applies the D1 migrations that database lacks, deploys the new release and prints the release before and after. The Worker's secrets stay as they are. Each workspace's task store applies its own migrations when it next starts.
The command keeps nothing on your machine between runs. Each deploy tags the
Worker's version with its release, such as v0.1.0, which is how a later run
knows the release deployed; the Cloudflare dashboard shows the tag on the
Worker's Deployments page.
npx looks for a newer release only of a package in its own cache, and runs a
global or project install of ntasks as it is. So before it deploys, such a
copy reads the latest release from the npm registry, or from the registry npm
is configured with. When the latest is newer, it prints both releases and
the same command with its options run as npx ntasks@latest deploy, and
deploys its own release only when you answer
y in the terminal; with no terminal, it stops. --dry-run prints them and
asks nothing. When the registry cannot be reached, the command says the check
was skipped and deploys.
Options
| Option | What it does |
|---|---|
| --name <name> | Names the Worker and its D1 database. The default is ntasks. |
| --account <id or name> | Chooses the Cloudflare account when your login reaches several. CLOUDFLARE_ACCOUNT_ID chooses it too. |
| --dry-run | Prints the plan and changes nothing in the account. It still logs in to read the account. |
| --version | Prints the release this package deploys. |
npx ntasks@<version> deploy deploys that release in place of the latest.
A run stops without changing anything when the login reaches several accounts
and none is chosen, or when the account's Worker of that name is not an Ntasks
deployment: its deployed version lacks the TASK_STORE Durable Object
binding to the class TaskStore or the D1 binding DB, or it has no
deployed version and no D1 database of its name. An update replaces the
Worker's code and applies migrations to its database, so run it with
--dry-run first when the account holds other Workers: the plan names the
account, the Worker, the database and the migrations.
Build and release
This package is built from tools/cli
in the Ntasks repository. From the repository root, pnpm build builds the
web app, then pnpm run package builds this package in tools/cli/dist:
scripts/build.ts bundles the Worker with wrangler from the root
wrangler.jsonc, copies the web app's
build and the D1 migrations, compiles src and writes the package's
wrangler.json, package.json and THIRD_PARTY_LICENSES.md. It then checks
the files npm pack would publish, and runs wrangler deploy --dry-run on the
configuration and bundle the command deploys.
The tests in test/ run the command against test/fake-wrangler.ts, a
stand-in for wrangler and a Cloudflare account kept in a JSON file. They never
reach Cloudflare.
Releasing
A release is the owner approving the CI run of the release pull request, merging the pull request, then pressing Approve and deploy. Agents never approve, merge or turn on auto-merge for a release pull request.
After each push to main, the Release PRs workflow
(.github/workflows/release-please.yml) runs
release-please. It keeps one
release pull request, titled chore: release main, for this package and
@notice-cx/ntasks-ui together, so the two never conflict. It lists each
package with changes to release and its next version, and releases only those.
While main holds a feat, fix, perf or revert commit or a breaking
change made since ntasks's last release, the pull request includes ntasks: it
raises version in tools/cli/package.json and in the MCP server's
SERVER_INFO, and adds those commits to the root CHANGELOG.md. Before 1.0.0,
a feat commit or a breaking change raises the minor version and any other
commit the patch version. A commit counts for this package unless every file it
changes is under one of the folders exclude-paths lists in
release-please-config.json: the website, the docs, the protocol, the skill,
the workflows and the tools other than tools/cli.
When the pull request lists ntasks, merging it creates the tag
ntasks-v<version> and its GitHub release, then starts the Release workflow
(.github/workflows/release.yml) on that tag. A pull request that lists only
@notice-cx/ntasks-ui starts no Release run; its steps are in
packages/ui.
The workflow waits for the owner to approve the npm environment. It then
checks and builds the repository and publishes tools/cli/dist to npm.
The owner's steps:
- On the pull request
chore: release main, open the Files changed tab, click Awaiting approval at the top right, then Approve workflows to run. GitHub holds the pull request's CI run until someone approves it, because a workflow, not a person, opened the pull request. - When its checks pass, click Merge when ready, then Confirm merge when ready, at the bottom of the Conversation tab.
- When the pull request lists ntasks, its Release run waits for review
(GitHub emails the owner): open it, click Review deployments, tick
npm and click Approve and deploy. When the pull request also
releases
@notice-cx/ntasks-ui, its Release UI package run waits the same way.
When more changes reach main before the pull request merges, release-please
rebuilds it, and the new CI run waits for approval again: repeat step 1.
To run a failed or rejected publish again, open Actions, choose
Release, click Run workflow, pick the tag ntasks-v<version> under Use
workflow from and click Run workflow. Releases up to 0.3.0 use the tag
v<version> instead, such as v0.3.0: the workflow at those tags checks that
name. The workflow stops if it is run on a branch, or on a tag that does not
name the version in tools/cli/package.json.
