Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Every debugging session is a potential contribution. Run `/d9-skills:skillops` t

## Important rules

- Code identifiers `@directus/`, `directus_*`, `DIRECTUS_*`, `npx directus`, `new Directus()` must NEVER be renamed
- Code identifiers `@directus/`, `directus_*`, `DIRECTUS_*`, `npx d9`, `new Directus()` must NEVER be renamed
- Plugins must be rebuilt (`pnpm build` in plugins/) before any deployment
- AWS region is eu-west-3 (Paris) for all services
- Contact: support@webcapsule.io
2 changes: 1 addition & 1 deletion api/src/cli/commands/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default async function init(): Promise<void> {
process.stdout.write(`\nThe configuration can be found in ${chalk.green(rootPath + '/.env')}\n`);
process.stdout.write(`\nStart Directus by running:\n`);
process.stdout.write(` ${chalk.blue('cd')} ${rootPath}\n`);
process.stdout.write(` ${chalk.blue('npx directus')} start\n`);
process.stdout.write(` ${chalk.blue('npx d9')} start\n`);

process.exit(0);
}
2 changes: 1 addition & 1 deletion directus/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ yarn install @wbce-d9/directus9
Create a new project with our simple CLI tool:

```
npx directus init
npx d9 init
```

The above command will create a directory with your project name, then walk you through the database configuration and
Expand Down
2 changes: 1 addition & 1 deletion docs/app/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
You can do this with the following command:

```sh
npx directus users passwd --email admin@example.com --password newpasswordhere
npx d9 users passwd --email admin@example.com --password newpasswordhere
```

## Why isn't d9 properly saving Chinese characters or emoji?
Expand Down
10 changes: 5 additions & 5 deletions docs/extensions/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ directory. In general, you need the following flow:

```sh
# Option 1
npx directus bootstrap
npx directus schema apply ./path/to/snapshot.yaml
npx d9 bootstrap
npx d9 schema apply ./path/to/snapshot.yaml

# Option 2 - without bootstrap, you must ensure that you run all required `bootstrap` tasks
npx directus database install
npx directus database migrate:latest
npx directus schema apply ./path/to/snapshot.yaml
npx d9 database install
npx d9 database migrate:latest
npx d9 schema apply ./path/to/snapshot.yaml
```

Take notice here - to comply with this flow, `migrations` directory **must not contain** tasks that modify the contents
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you're experiencing issues or think you have found a problem in d9, be sure t

1. Ensure your server and database meet the [minimum requirements](/self-hosted/docker-guide.html#supported-databases).
2. Ensure you're on the [latest version]({{GITHUB_URL}}/releases/latest) of d9.
3. Stop `CTRL+C` and restart the server `npx directus start`.
3. Stop `CTRL+C` and restart the server `npx d9 start`.
4. Run the database migration script: `directus database migrate:latest`\
_Note: backup your database first._
5. Disable any data-caching within your project.
Expand Down
41 changes: 21 additions & 20 deletions docs/self-hosted/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@ readTime: 7 min read

## Server

For server-side CLI, all functionality can be accessed by running `npx directus <command>` in your project folder.
For server-side CLI, all functionality can be accessed by running `npx d9 <command>` in your project folder.
For legacy purposes, the CLI is also accessible via `npx directus <command>`.

### Initialize a New Project

```bash
npx directus init
npx d9 init
```

Will install the required database driver, and create a `.env` file based on the inputted values.

### Bootstrap a Project

```bash
npx directus bootstrap
npx d9 bootstrap
```

Will use an existing `.env` file (or existing environment variables) to either install the database (if it's empty) or
Expand All @@ -57,7 +58,7 @@ custom migration or an external service, for example).
### Install the Database

```bash
npx directus database install
npx d9 database install
```

Installs the initial d9 system tables on an empty database. Used internally by `bootstrap`.
Expand All @@ -70,13 +71,13 @@ You may want to use `directus bootstrap` instead.
### Upgrade the Database

```bash
npx directus database migrate:latest
npx directus database migrate:up
npx directus database migrate:down
npx d9 database migrate:latest
npx d9 database migrate:up
npx d9 database migrate:down
```

Migrate the database up/down to match the versions of d9. Once you update d9 itself, make sure to run
`npx directus database migrate:latest` (or `npx directus bootstrap`) to update your database.
`npx d9 database migrate:latest` (or `npx d9 bootstrap`) to update your database.

### Migrate Schema to a different Environment

Expand All @@ -90,13 +91,13 @@ collections, fields, and relations, and their configuration. This snapshot can b
with your team. To generate the snapshot, run

```bash
npx directus schema snapshot ./snapshot.yaml
npx d9 schema snapshot ./snapshot.yaml
```

To run non-interactively (e.g. when running in a CI/CD workflow), run

```bash
npx directus schema snapshot --yes ./snapshot.yaml
npx d9 schema snapshot --yes ./snapshot.yaml
```

Note, that this will force overwrite existing snapshot files.
Expand All @@ -107,7 +108,7 @@ To keep multiple snapshot organized by date, create a folder `snapshots` in your
following custom script to your `package.json`:

```bash
"create-snapshot": "npx directus schema snapshot ./snapshots/\"$(date \"+%F\")\"-snapshot-\"$(date \"+%s\")\".yaml"
"create-snapshot": "npx d9 schema snapshot ./snapshots/\"$(date \"+%F\")\"-snapshot-\"$(date \"+%s\")\".yaml"
```

When you run the command via `npm run create-snapshot` it will create a new snapshot with the following naming schema:
Expand All @@ -126,43 +127,43 @@ snapshot.
To apply the generated snapshot, run

```bash
npx directus schema apply ./path/to/snapshot.yaml
npx d9 schema apply ./path/to/snapshot.yaml
```

To run non-interactively (e.g. when running in a CI/CD workflow), run

```bash
npx directus schema apply --yes ./path/to/snapshot.yaml
npx d9 schema apply --yes ./path/to/snapshot.yaml
```

To diff the schema and database and print out the planned changes, run

```bash
npx directus schema apply --dry-run ./path/to/snapshot.yaml
npx d9 schema apply --dry-run ./path/to/snapshot.yaml
```

### Creating Users

To create a new user with a specific role, run

```bash
npx directus users create --email <user-email> --password <password> --role <role-uuid>
npx d9 users create --email <user-email> --password <password> --role <role-uuid>
```

#### Updating User Password

To update the password of an existing user, run

```bash
npx directus users passwd --email <user-email> --password <new-password>
npx d9 users passwd --email <user-email> --password <new-password>
```

### Creating Roles

To create a new role, run

```bash
npx directus roles create --role <role-name>
npx d9 roles create --role <role-name>
```

These roles are created with the
Expand All @@ -172,22 +173,22 @@ the App by default.
To create a new role with admin access, set the `--admin` flag to `true`, such as

```bash
npx directus roles create --role <role-name> --admin true
npx d9 roles create --role <role-name> --admin true
```

### Count Items in a Collection

To count the amount of items in a given collection, run

```bash
npx directus count <collection-name>
npx d9 count <collection-name>
```

---

## Client

For the client-side CLI, all functionality can be accessed by running `npx directusctl <command>`. You can also install
For the client-side CLI, all functionality can be accessed by running `npx d9ctl <command>`. You can also install
`@wbce-d9/cli` on your project dependencies or globally on your machine. Note that if you run `directusctl` (installed
globally) in a folder containing a project that has a version of `@wbce-d9/cli` installed, the running global CLI will
forward it's execution to the local installed version instead.
Expand Down
2 changes: 1 addition & 1 deletion docs/self-hosted/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ folder of your project) for its configuration. You can change this path and file
environment variable before starting d9. For example:

```bash
CONFIG_PATH="/path/to/config.js" npx directus start
CONFIG_PATH="/path/to/config.js" npx d9 start
```

In case you prefer using a configuration file instead of environment variables, you can also use the `CONFIG_PATH`
Expand Down
4 changes: 2 additions & 2 deletions docs/self-hosted/upgrades-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readTime: 4 min read

1. Backup your project
2. Run `npm update`
3. Run `npx directus database migrate:latest` to update the DB
3. Run `npx d9 database migrate:latest` to update the DB

## Backing-up a Project

Expand All @@ -40,7 +40,7 @@ d9 can be reverted to an earlier version by going to your terminal, navigating i
running `npm install directus@<version>`.

If you ran any database migrations for a newer version, you can revert those by running
`npx directus database migrate:down`
`npx d9 database migrate:down`

## Deleting a Project

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import { ... } from "@wbce-d9/some-package"

```bash
npm update
npx directus start
npx d9 start
```

## JS SDK
Expand Down
Loading