docs(cli): add a main page for Emigrate's CLI

This commit is contained in:
Joakim Carlstein 2024-02-09 14:04:52 +01:00 committed by Joakim Carlstein
parent 0360d0b82f
commit 0c597fd7a8
3 changed files with 101 additions and 14 deletions

View file

@ -78,23 +78,32 @@ export default defineConfig({
],
},
{
label: 'Commands',
label: 'Command Line Interface',
items: [
{
label: 'emigrate up',
link: '/commands/up/',
label: 'Introduction',
link: '/commands/',
},
{
label: 'emigrate list',
link: '/commands/list/',
},
{
label: 'emigrate new',
link: '/commands/new/',
},
{
label: 'emigrate remove',
link: '/commands/remove/',
label: 'Commands',
items: [
{
label: 'emigrate up',
link: '/commands/up/',
},
{
label: 'emigrate list',
link: '/commands/list/',
},
{
label: 'emigrate new',
link: '/commands/new/',
},
{
label: 'emigrate remove',
link: '/commands/remove/',
},
],
},
],
},
@ -106,7 +115,7 @@ export default defineConfig({
link: '/guides/typescript/',
},
{
label: 'Baseline',
label: 'Baseline existing database',
link: '/guides/baseline/',
},
],

View file

@ -0,0 +1,73 @@
---
title: "CLI Introduction"
description: "Some basic information about the Emigrate CLI."
---
import { Tabs, TabItem, LinkCard } from '@astrojs/starlight/components';
import Link from '@components/Link.astro';
Emigrate comes with a CLI that you can use to manage your migrations. The CLI is a powerful tool that allows you to create, run, and manage migrations.
### Installing the Emigrate CLI
<Tabs>
<TabItem label="npm">
```bash
npm install @emigrate/cli
```
</TabItem>
<TabItem label="pnpm">
```bash
pnpm add @emigrate/cli
```
</TabItem>
<TabItem label="yarn">
```bash
yarn add @emigrate/cli
```
</TabItem>
<TabItem label="bun">
```bash
bun add @emigrate/cli
```
</TabItem>
<TabItem label="deno">
```json title="package.json" {3,6}
{
"scripts": {
"emigrate": "emigrate"
},
"dependencies": {
"@emigrate/cli": "*"
}
}
```
</TabItem>
</Tabs>
### Existing commands
<LinkCard
href="up/"
title="emigrate up"
description="The command for executing migrations, or showing pending migrations in dry run mode."
/>
<LinkCard
href="list/"
title="emigrate list"
description="The command for listing all migrations and their status."
/>
<LinkCard
href="new/"
title="emigrate new"
description="The command for creating new migration files."
/>
<LinkCard
href="remove/"
title="emigrate remove"
description="The command for removing migrations from the migration history."
/>