Skip to content

Commit 63bf45b

Browse files
authored
Fix missing chalk dependency and improve README (#318)
1 parent 72f2287 commit 63bf45b

3 files changed

Lines changed: 73 additions & 22 deletions

File tree

README.md

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ teams and execute commands in a profile's context.
99

1010
1. [Getting Started](#getting-started)
1111
2. [About the Project](#about-the-project)
12-
3. [Building the Project](#building-the-project)
13-
4. [Release Process](#release-process)
14-
5. [Contributing](#contributing)
15-
6. [License](#license)
12+
3. [Building the Project](#building-and-using-the-project-locally)
13+
4. [Troubleshooting](#troubleshooting)
14+
5. [Release Process](#release-process)
15+
6. [Contributing](#contributing)
16+
7. [License](#license)
1617

1718
## Getting Started
1819

@@ -85,16 +86,65 @@ content-cli pull package -h
8586
## Building and Using the Project locally
8687

8788
This tool is tightly connected with the Celonis Platform and all capabilities require to have access to a Celonis Platform Team.
88-
After cloning the project, the next step is to install the project dependencies. We use `yarn` as our package manager,
89-
so running `yarn install` on the project root folder should install all the necessary dependencies. After installing
90-
the project dependencies, you can run `yarn build` to build the project artifact. To use the built artifact, you can
91-
run `node content-cli.js` in the generated `dist` folder.
92-
93-
If we want to use a specific local build of the tool globally, we can do this by:
94-
- Move to the root directory of the project.
95-
- Execute `cd dist`, to move to the `dist` directory.
96-
- Execute the `npm link` command.
97-
This will create a symbolic link in the global `node_modules` directory, allowing you to run the CLI from anywhere on your machine.
89+
90+
### Prerequisites
91+
92+
- **Node.js** `>=18.20.5` (LTS recommended). Check with `node -v`.
93+
- **yarn** package manager. Install with `npm install -g yarn` if not already available.
94+
95+
### Build steps
96+
97+
```bash
98+
git clone https://github.com/celonis/content-cli.git
99+
cd content-cli
100+
yarn install
101+
yarn build
102+
```
103+
104+
The build compiles TypeScript into the `dist/` folder and copies `package.json` there.
105+
106+
### Running the built CLI
107+
108+
You can run the built artifact directly from the `dist` folder:
109+
110+
```bash
111+
node dist/content-cli.js -h
112+
```
113+
114+
### Installing the local build globally
115+
116+
To use your local build as the global `content-cli` command:
117+
118+
```bash
119+
cd dist
120+
npm link
121+
```
122+
123+
This creates a symbolic link in the global `node_modules` directory, allowing you to run `content-cli` from anywhere on your machine. To unlink later, run `npm unlink -g @celonis/content-cli`.
124+
125+
## Troubleshooting
126+
127+
### `Error: Cannot find module '...'`
128+
129+
If you see a `Cannot find module` error when running `content-cli`, dependencies may not be installed correctly:
130+
131+
- **Global install:** Try updating to the latest version: `npm install -g @celonis/content-cli@latest`.
132+
- **Local development:** Run `yarn install` from the project root before building.
133+
134+
### `content-cli: command not found`
135+
136+
- Ensure Node.js is installed and on your `PATH` (`node -v`).
137+
- If installed via `npm install -g`, check that npm's global `bin` directory is in your `PATH`. You can find it with `npm bin -g`.
138+
- If using `npm link`, make sure you ran it from the `dist/` directory (not the project root).
139+
140+
### Node.js version errors
141+
142+
Content CLI requires Node.js `>=18.20.5`. If you see compatibility errors, upgrade your Node.js installation. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions:
143+
144+
```bash
145+
nvm install --lts
146+
nvm use --lts
147+
```
98148

99149
## Release Process
100150

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"dependencies": {
2121
"adm-zip": "0.5.14",
22+
"chalk": "4.1.2",
2223
"uuid": "9.0.1",
2324
"axios": "1.13.5",
2425
"commander": "13.1.0",

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,14 @@ caniuse-lite@^1.0.30001688:
971971
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz"
972972
integrity sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==
973973

974+
chalk@4.1.2, chalk@^4.0.0, chalk@^4.0.2:
975+
version "4.1.2"
976+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
977+
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
978+
dependencies:
979+
ansi-styles "^4.1.0"
980+
supports-color "^7.1.0"
981+
974982
chalk@^2.3.0:
975983
version "2.4.2"
976984
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
@@ -980,14 +988,6 @@ chalk@^2.3.0:
980988
escape-string-regexp "^1.0.5"
981989
supports-color "^5.3.0"
982990

983-
chalk@^4.0.0, chalk@^4.0.2:
984-
version "4.1.2"
985-
resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
986-
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
987-
dependencies:
988-
ansi-styles "^4.1.0"
989-
supports-color "^7.1.0"
990-
991991
chalk@~5.4.1:
992992
version "5.4.1"
993993
resolved "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz"

0 commit comments

Comments
 (0)