ende init
Examples
ende init
Project initialized
Run these commands to get started
# Run the server
ende run --allow-net main.ts
# Run the server and watch for file changes
ende task dev
# Run the tests
ende test
The init subcommand creates three files: main.ts, main_test.ts and
ende.json. They show how to write an Ende program and how to test it. The
main.ts file is a small web server: its exported handler function answers
/ with an HTML page and /api with JSON, and main_test.ts tests that
function. The dev task in ende.json runs the server and restarts it when a
file changes.
You can also specify an argument to ende init to initialize a project in a
specific directory:
ende init my_ende_project
Project initialized
Run these commands to get started
cd my_ende_project
# Run the server
ende run --allow-net main.ts
# Run the server and watch for file changes
ende task dev
# Run the tests
ende test
Init a JSR package
By running ende init --lib Ende will bootstrap a project that is ready to be
published on JSR.
ende init --lib
Project initialized
Run these commands to get started
# Run the tests
ende test
# Run the tests and watch for file changes
ende task dev
# Publish to JSR (dry run)
ende publish --dry-run
Inside ende.json you'll see that the entries for name, exports and
version are prefilled.
{
"name": "my-lib",
"version": "0.1.0",
"exports": "./mod.ts",
"tasks": {
"dev": "ende test --watch"
},
"license": "MIT",
"imports": {
"@ende/assert": "jsr:@ende/assert@^2026.10.15"
}
}Initialize a web server
Running ende init --serve bootstraps a web server that works with
ende serve.
ende init --serve
Project initialized
Run these commands to get started
# Run the server
ende serve -R main.ts
# Run the server and watch for file changes
ende task dev
# Run the tests
ende test -R
Your ende.json file will look like
this:
{
"tasks": {
"dev": "ende serve --watch -R main.ts"
},
"imports": {
"@ende/assert": "jsr:@ende/assert@^2026.10.15",
"@ende/http": "jsr:@ende/http@^2026.10.15"
}
}Now, you can start your web server, which
watches for changes, by running ende task dev.
ende task dev
Task dev ende serve --watch -R main.ts
Watcher Process started.
ende serve: Listening on http://0.0.0.0:8000/
Initialize an empty project
Running ende init --empty bootstraps an empty project with a basic console
log.
ende init --empty
Project initialized
Run these commands to get started
# Run the program
ende run main.ts
# Run the program and watch for file changes
ende task dev
Your ende.json file will look like
this:
{
"tasks": {
"dev": "ende run --watch main.ts"
}
}Now, you can run the project, which
watches for changes, by running ende task dev.
ende task dev
Task dev ende run --watch main.ts
Watcher Process started.
Hello world!
Generate a library project
You can append a --lib flag to add extra parameters to your ende.json, such
as "name", "version" and an "exports" fields.
ende init my_ende_project --lib
Project initialized
The resulting ende.json will be as follows:
{
"name": "my_ende_project",
"version": "0.1.0",
"exports": "./mod.ts",
"tasks": {
"dev": "ende test --watch"
},
"license": "MIT",
"imports": {
"@ende/assert": "jsr:@ende/assert@^2026.10.15"
}
}Command line usage:
initInitialize a new project
Options
--empty
Generate a minimal project with just main.ts and ende.json.
--jsr
Generate a project from a JSR package.
--lib
Generate an example library project.
--serve
Generate an example project for ende serve.
--yes, -y
Bypass the prompt and run with full permissions.