Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoRCD committed Jan 3, 2025
1 parent 47836c7 commit 664fcc9
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="../../assets/preview.png" width="100%" alt="Shelve" />
<img src="../../assets/cover.png" width="100%" alt="Shelve" />

# Shelve CLI

Expand All @@ -22,25 +22,24 @@ bun a -d @shelve/cli

## Configuration

Configuration is loaded by [unjs/c12](https://github.com/unjs/c12) from cwd. You can use either `shelve.config.json`, `shelve.config.{ts,js,mjs,cjs}`, but running the CLI without any configuration will create a `shelve.config.json` file.
You have the option to create a `shelve.config.ts` file to enable type checking and autocompletion. The file should contain the following content:

```ts title="shelve.config.ts"
import { createShelveConfig } from "@shelve/cli"

export default createShelveConfig({
project: "my-project",
slug: "nuxtlabs",
token: "my-token",
url: "https://app.shelve.cloud",
confirmChanges: false,
envFileName: '.env',
autoUppercase: true,
})
```
Configuration is loaded from cwd. You can use either `shelve.json`, `shelve.config.json` or `.shelverc.json`, but running the CLI without any configuration will create a `shelve.json` file.

The CLI also has a json schema for the configuration file. that can be used to validate the configuration file. (see it [here](https://raw.githubusercontent.com/HugoRCD/shelve/main/packages/types/schema.json))

### Configuration example

```json
{
"slug": "nuxtlabs",
"project": "@nuxt/ui",
"confirmChanges": true
}
```

### Monorepo configuration

If you are using a monorepo, Shelve will automatically detect the root of the monorepo and look for the global `shelve.json` file. You can define here common configurations for all the projects in the monorepo (the team slug for example).

## Usage

```bash
Expand All @@ -65,6 +64,10 @@ Commands:
help [command] display help for command
```

### Monorepo usage

If you are using a monorepo, running a command at the root level will execute the command for all the projects in the monorepo that have a `shelve.json` file.

<!-- automd:fetch url="gh:hugorcd/markdown/main/src/local_development.md" -->

<details>
Expand Down

0 comments on commit 664fcc9

Please sign in to comment.