@claryai/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/README.md +197 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/ajv.d.ts +3 -0
- package/dist/ajv.d.ts.map +1 -0
- package/dist/ajv.js +13 -0
- package/dist/analytics/analytics.d.ts +370 -0
- package/dist/analytics/analytics.d.ts.map +1 -0
- package/dist/analytics/analytics.js +143 -0
- package/dist/config.d.ts +34 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +134 -0
- package/dist/dbt/context.d.ts +14 -0
- package/dist/dbt/context.d.ts.map +1 -0
- package/dist/dbt/context.js +76 -0
- package/dist/dbt/context.test.d.ts +2 -0
- package/dist/dbt/context.test.d.ts.map +1 -0
- package/dist/dbt/context.test.js +152 -0
- package/dist/dbt/manifest.d.ts +7 -0
- package/dist/dbt/manifest.d.ts.map +1 -0
- package/dist/dbt/manifest.js +23 -0
- package/dist/dbt/models.d.ts +43 -0
- package/dist/dbt/models.d.ts.map +1 -0
- package/dist/dbt/models.js +256 -0
- package/dist/dbt/models.test.d.ts +2 -0
- package/dist/dbt/models.test.d.ts.map +1 -0
- package/dist/dbt/models.test.js +19 -0
- package/dist/dbt/profile.d.ts +9 -0
- package/dist/dbt/profile.d.ts.map +1 -0
- package/dist/dbt/profile.js +86 -0
- package/dist/dbt/profiles.test.d.ts +2 -0
- package/dist/dbt/profiles.test.d.ts.map +1 -0
- package/dist/dbt/profiles.test.js +50 -0
- package/dist/dbt/schema.d.ts +31 -0
- package/dist/dbt/schema.d.ts.map +1 -0
- package/dist/dbt/schema.js +49 -0
- package/dist/dbt/targets/Bigquery/index.d.ts +18 -0
- package/dist/dbt/targets/Bigquery/index.d.ts.map +1 -0
- package/dist/dbt/targets/Bigquery/index.js +105 -0
- package/dist/dbt/targets/Bigquery/oauth.d.ts +2 -0
- package/dist/dbt/targets/Bigquery/oauth.d.ts.map +1 -0
- package/dist/dbt/targets/Bigquery/oauth.js +43 -0
- package/dist/dbt/targets/Bigquery/serviceAccount.d.ts +35 -0
- package/dist/dbt/targets/Bigquery/serviceAccount.d.ts.map +1 -0
- package/dist/dbt/targets/Bigquery/serviceAccount.js +149 -0
- package/dist/dbt/targets/Databricks/oauth.d.ts +21 -0
- package/dist/dbt/targets/Databricks/oauth.d.ts.map +1 -0
- package/dist/dbt/targets/Databricks/oauth.js +184 -0
- package/dist/dbt/targets/athena.d.ts +21 -0
- package/dist/dbt/targets/athena.d.ts.map +1 -0
- package/dist/dbt/targets/athena.js +91 -0
- package/dist/dbt/targets/athena.test.d.ts +2 -0
- package/dist/dbt/targets/athena.test.d.ts.map +1 -0
- package/dist/dbt/targets/athena.test.js +60 -0
- package/dist/dbt/targets/clickhouse.d.ts +24 -0
- package/dist/dbt/targets/clickhouse.d.ts.map +1 -0
- package/dist/dbt/targets/clickhouse.js +90 -0
- package/dist/dbt/targets/databricks.d.ts +27 -0
- package/dist/dbt/targets/databricks.d.ts.map +1 -0
- package/dist/dbt/targets/databricks.js +138 -0
- package/dist/dbt/targets/duckdb.d.ts +16 -0
- package/dist/dbt/targets/duckdb.d.ts.map +1 -0
- package/dist/dbt/targets/duckdb.js +63 -0
- package/dist/dbt/targets/duckdb.test.d.ts +2 -0
- package/dist/dbt/targets/duckdb.test.d.ts.map +1 -0
- package/dist/dbt/targets/duckdb.test.js +37 -0
- package/dist/dbt/targets/postgres.d.ts +26 -0
- package/dist/dbt/targets/postgres.d.ts.map +1 -0
- package/dist/dbt/targets/postgres.js +142 -0
- package/dist/dbt/targets/redshift.d.ts +23 -0
- package/dist/dbt/targets/redshift.d.ts.map +1 -0
- package/dist/dbt/targets/redshift.js +96 -0
- package/dist/dbt/targets/snowflake.d.ts +4 -0
- package/dist/dbt/targets/snowflake.d.ts.map +1 -0
- package/dist/dbt/targets/snowflake.js +134 -0
- package/dist/dbt/targets/trino.d.ts +16 -0
- package/dist/dbt/targets/trino.d.ts.map +1 -0
- package/dist/dbt/targets/trino.js +65 -0
- package/dist/dbt/templating.d.ts +15 -0
- package/dist/dbt/templating.d.ts.map +1 -0
- package/dist/dbt/templating.js +50 -0
- package/dist/dbt/templating.test.d.ts +2 -0
- package/dist/dbt/templating.test.d.ts.map +1 -0
- package/dist/dbt/templating.test.js +51 -0
- package/dist/dbt/types.d.ts +17 -0
- package/dist/dbt/types.d.ts.map +1 -0
- package/dist/dbt/types.js +2 -0
- package/dist/dbt/validation.d.ts +9 -0
- package/dist/dbt/validation.d.ts.map +1 -0
- package/dist/dbt/validation.js +54 -0
- package/dist/env.d.ts +12 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +40 -0
- package/dist/error.d.ts +2 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +12 -0
- package/dist/globalState.d.ts +29 -0
- package/dist/globalState.d.ts.map +1 -0
- package/dist/globalState.js +67 -0
- package/dist/handlers/asyncQuery.d.ts +7 -0
- package/dist/handlers/asyncQuery.d.ts.map +1 -0
- package/dist/handlers/asyncQuery.js +50 -0
- package/dist/handlers/compile.d.ts +16 -0
- package/dist/handlers/compile.d.ts.map +1 -0
- package/dist/handlers/compile.js +277 -0
- package/dist/handlers/compile.test.d.ts +2 -0
- package/dist/handlers/compile.test.d.ts.map +1 -0
- package/dist/handlers/compile.test.js +201 -0
- package/dist/handlers/createProject.d.ts +37 -0
- package/dist/handlers/createProject.d.ts.map +1 -0
- package/dist/handlers/createProject.js +272 -0
- package/dist/handlers/dbt/apiClient.d.ts +14 -0
- package/dist/handlers/dbt/apiClient.d.ts.map +1 -0
- package/dist/handlers/dbt/apiClient.js +167 -0
- package/dist/handlers/dbt/compile.d.ts +35 -0
- package/dist/handlers/dbt/compile.d.ts.map +1 -0
- package/dist/handlers/dbt/compile.js +220 -0
- package/dist/handlers/dbt/getDbtProfileTargetName.d.ts +9 -0
- package/dist/handlers/dbt/getDbtProfileTargetName.d.ts.map +1 -0
- package/dist/handlers/dbt/getDbtProfileTargetName.js +44 -0
- package/dist/handlers/dbt/getDbtVersion.d.ts +16 -0
- package/dist/handlers/dbt/getDbtVersion.d.ts.map +1 -0
- package/dist/handlers/dbt/getDbtVersion.js +141 -0
- package/dist/handlers/dbt/getDbtVersion.mocks.d.ts +11 -0
- package/dist/handlers/dbt/getDbtVersion.mocks.d.ts.map +1 -0
- package/dist/handlers/dbt/getDbtVersion.mocks.js +70 -0
- package/dist/handlers/dbt/getDbtVersion.test.d.ts +2 -0
- package/dist/handlers/dbt/getDbtVersion.test.d.ts.map +1 -0
- package/dist/handlers/dbt/getDbtVersion.test.js +97 -0
- package/dist/handlers/dbt/getWarehouseClient.d.ts +24 -0
- package/dist/handlers/dbt/getWarehouseClient.d.ts.map +1 -0
- package/dist/handlers/dbt/getWarehouseClient.js +312 -0
- package/dist/handlers/dbt/refresh.d.ts +11 -0
- package/dist/handlers/dbt/refresh.d.ts.map +1 -0
- package/dist/handlers/dbt/refresh.js +114 -0
- package/dist/handlers/dbt/run.d.ts +14 -0
- package/dist/handlers/dbt/run.d.ts.map +1 -0
- package/dist/handlers/dbt/run.js +67 -0
- package/dist/handlers/deploy.d.ts +26 -0
- package/dist/handlers/deploy.d.ts.map +1 -0
- package/dist/handlers/deploy.js +377 -0
- package/dist/handlers/diagnostics.d.ts +11 -0
- package/dist/handlers/diagnostics.d.ts.map +1 -0
- package/dist/handlers/diagnostics.js +194 -0
- package/dist/handlers/download.d.ts +29 -0
- package/dist/handlers/download.d.ts.map +1 -0
- package/dist/handlers/download.js +955 -0
- package/dist/handlers/exportChartImage.d.ts +7 -0
- package/dist/handlers/exportChartImage.d.ts.map +1 -0
- package/dist/handlers/exportChartImage.js +33 -0
- package/dist/handlers/generate.d.ts +13 -0
- package/dist/handlers/generate.d.ts.map +1 -0
- package/dist/handlers/generate.js +159 -0
- package/dist/handlers/generateExposures.d.ts +8 -0
- package/dist/handlers/generateExposures.d.ts.map +1 -0
- package/dist/handlers/generateExposures.js +100 -0
- package/dist/handlers/getProject.d.ts +6 -0
- package/dist/handlers/getProject.d.ts.map +1 -0
- package/dist/handlers/getProject.js +43 -0
- package/dist/handlers/installSkills.d.ts +12 -0
- package/dist/handlers/installSkills.d.ts.map +1 -0
- package/dist/handlers/installSkills.js +321 -0
- package/dist/handlers/lint/ajvToSarif.d.ts +66 -0
- package/dist/handlers/lint/ajvToSarif.d.ts.map +1 -0
- package/dist/handlers/lint/ajvToSarif.js +222 -0
- package/dist/handlers/lint/sarifFormatter.d.ts +14 -0
- package/dist/handlers/lint/sarifFormatter.d.ts.map +1 -0
- package/dist/handlers/lint/sarifFormatter.js +111 -0
- package/dist/handlers/lint.d.ts +8 -0
- package/dist/handlers/lint.d.ts.map +1 -0
- package/dist/handlers/lint.js +308 -0
- package/dist/handlers/listProjects.d.ts +6 -0
- package/dist/handlers/listProjects.d.ts.map +1 -0
- package/dist/handlers/listProjects.js +53 -0
- package/dist/handlers/login/oauth.d.ts +2 -0
- package/dist/handlers/login/oauth.d.ts.map +1 -0
- package/dist/handlers/login/oauth.js +27 -0
- package/dist/handlers/login/pat.d.ts +2 -0
- package/dist/handlers/login/pat.d.ts.map +1 -0
- package/dist/handlers/login/pat.js +31 -0
- package/dist/handlers/login.d.ts +15 -0
- package/dist/handlers/login.d.ts.map +1 -0
- package/dist/handlers/login.js +239 -0
- package/dist/handlers/metadataFile.d.ts +9 -0
- package/dist/handlers/metadataFile.d.ts.map +1 -0
- package/dist/handlers/metadataFile.js +34 -0
- package/dist/handlers/oauthLogin.d.ts +6 -0
- package/dist/handlers/oauthLogin.d.ts.map +1 -0
- package/dist/handlers/oauthLogin.js +191 -0
- package/dist/handlers/preview.d.ts +29 -0
- package/dist/handlers/preview.d.ts.map +1 -0
- package/dist/handlers/preview.js +415 -0
- package/dist/handlers/renameHandler.d.ts +16 -0
- package/dist/handlers/renameHandler.d.ts.map +1 -0
- package/dist/handlers/renameHandler.js +160 -0
- package/dist/handlers/runChart.d.ts +10 -0
- package/dist/handlers/runChart.d.ts.map +1 -0
- package/dist/handlers/runChart.js +105 -0
- package/dist/handlers/selectProject.d.ts +20 -0
- package/dist/handlers/selectProject.d.ts.map +1 -0
- package/dist/handlers/selectProject.js +91 -0
- package/dist/handlers/setProject.d.ts +14 -0
- package/dist/handlers/setProject.d.ts.map +1 -0
- package/dist/handlers/setProject.js +131 -0
- package/dist/handlers/setWarehouse.d.ts +14 -0
- package/dist/handlers/setWarehouse.d.ts.map +1 -0
- package/dist/handlers/setWarehouse.js +94 -0
- package/dist/handlers/sql.d.ts +9 -0
- package/dist/handlers/sql.d.ts.map +1 -0
- package/dist/handlers/sql.js +89 -0
- package/dist/handlers/utils.d.ts +11 -0
- package/dist/handlers/utils.d.ts.map +1 -0
- package/dist/handlers/utils.js +36 -0
- package/dist/handlers/validate.d.ts +22 -0
- package/dist/handlers/validate.d.ts.map +1 -0
- package/dist/handlers/validate.js +201 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +581 -0
- package/dist/lightdash/loader.d.ts +21 -0
- package/dist/lightdash/loader.d.ts.map +1 -0
- package/dist/lightdash/loader.js +122 -0
- package/dist/lightdash/projectType.d.ts +84 -0
- package/dist/lightdash/projectType.d.ts.map +1 -0
- package/dist/lightdash/projectType.js +75 -0
- package/dist/lightdash-config/index.d.ts +2 -0
- package/dist/lightdash-config/index.d.ts.map +1 -0
- package/dist/lightdash-config/index.js +41 -0
- package/dist/lightdash-config/lightdash-config.test.d.ts +2 -0
- package/dist/lightdash-config/lightdash-config.test.d.ts.map +1 -0
- package/dist/lightdash-config/lightdash-config.test.js +70 -0
- package/dist/styles.d.ts +10 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +14 -0
- package/entitlements.plist +33 -0
- package/package.json +71 -0
- package/track.sh +116 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Copyright (c) 2021-present Telescope Technology Limited (trading as “Lightdash”)
|
|
2
|
+
|
|
3
|
+
Portions of this software are licensed as follows:
|
|
4
|
+
|
|
5
|
+
* All content that resides under the "packages/backend/src/ee" directory of this repository, if that directory exists, is licensed under the license defined in "packages/backend/src/ee/LICENSE".
|
|
6
|
+
* All third party components incorporated into the Lightdash Software are licensed under the original license provided by the owner of the applicable component.
|
|
7
|
+
* Content outside of the above mentioned directories or restrictions above is available under the "MIT" license as defined below.
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
## Clary CLI
|
|
2
|
+
|
|
3
|
+
Clary CLI tool
|
|
4
|
+
|
|
5
|
+
## How to install
|
|
6
|
+
|
|
7
|
+
`npm i -g @claryai/cli`
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Usage: clary [options] [command]
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
-h, --help display help for command
|
|
16
|
+
|
|
17
|
+
Commands:
|
|
18
|
+
version output the version number
|
|
19
|
+
[dbt_command] runs dbt
|
|
20
|
+
help [command] display help for command
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
eg: `clary test` Runs `dbt test`
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
First build the package
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
pnpm cli-build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then run the cli commands with `node` and pointing to the `dist/index.js` file
|
|
34
|
+
|
|
35
|
+
### Examples from clary root folder
|
|
36
|
+
|
|
37
|
+
Clary login
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
node ./packages/cli/dist/index.js login http://localhost:3000
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Clary compile
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
node ./packages/cli/dist/index.js deploy --project-dir ./examples/full-jaffle-shop-demo/dbt --profiles-dir ./examples/full-jaffle-shop-demo/profiles --use-batched-deploy
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Clary generate
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
node ./packages/cli/dist/index.js generate --project-dir ./examples/full-jaffle-shop-demo/dbt --profiles-dir ./examples/full-jaffle-shop-demo/profiles
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Clary preview
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
node ./packages/cli/dist/index.js preview --project-dir ./examples/full-jaffle-shop-demo/dbt --profiles-dir ./examples/full-jaffle-shop-demo/profiles
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Clary run
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
node ./packages/cli/dist/index.js dbt run --project-dir ./examples/full-jaffle-shop-demo/dbt --profiles-dir ./examples/full-jaffle-shop-demo/profiles -s
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Testing different dbt versions
|
|
68
|
+
|
|
69
|
+
If you want to test different dbt versions, you can replace the string `dbt` in the "execa" calls in the package with `dbt${YOUR_VERSION}`, eg: `dbt1.8`.
|
|
70
|
+
|
|
71
|
+
## Automation, CI & Agentic Usage
|
|
72
|
+
|
|
73
|
+
The CLI supports non-interactive usage for CI/CD pipelines and agentic LLM coding tools (Claude Code, Cursor, Windsurf, etc.).
|
|
74
|
+
|
|
75
|
+
The `--non-interactive` flag is designed for environments where interactive prompts would block execution, such as automated pipelines or when an AI coding agent is running CLI commands on your behalf.
|
|
76
|
+
|
|
77
|
+
### Global Options
|
|
78
|
+
|
|
79
|
+
| Flag | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| `--non-interactive` | Disable all interactive prompts. Commands auto-select defaults where possible. Designed for CI/CD and agentic coding tools. |
|
|
82
|
+
|
|
83
|
+
### Command-Specific Options
|
|
84
|
+
|
|
85
|
+
| Command | Flag | Description |
|
|
86
|
+
|---------|------|-------------|
|
|
87
|
+
| `login` | `--token <token>` | Authenticate with personal access token (bypasses OAuth) |
|
|
88
|
+
| `login` | `--email <email>` | Login with email and password |
|
|
89
|
+
| `login` | `--project <uuid>` | Select a specific project by UUID after login |
|
|
90
|
+
| `deploy` | `-y, --assume-yes` | Answer yes to all confirmation prompts |
|
|
91
|
+
| `generate` | `-y, --assume-yes` | Answer yes to prompts |
|
|
92
|
+
| `dbt run` | `-y, --assume-yes` | Answer yes to prompts |
|
|
93
|
+
| `rename` | `-y, --assume-yes` | Answer yes to prompts |
|
|
94
|
+
|
|
95
|
+
### Environment Variables
|
|
96
|
+
|
|
97
|
+
| Variable | Description |
|
|
98
|
+
|----------|-------------|
|
|
99
|
+
| `CI=true` | Equivalent to `--non-interactive` |
|
|
100
|
+
| `CLARY_API_KEY` | API token for authentication (can be used instead of `--token`) |
|
|
101
|
+
|
|
102
|
+
### Example Automation Scripts
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Login with token (auto-selects first project in non-interactive mode)
|
|
106
|
+
clary login https://app.getclary.com \
|
|
107
|
+
--token $CLARY_API_KEY \
|
|
108
|
+
--non-interactive
|
|
109
|
+
|
|
110
|
+
# Login with token and specific project
|
|
111
|
+
clary login https://app.getclary.com \
|
|
112
|
+
--token $CLARY_API_KEY \
|
|
113
|
+
--project abc-123-uuid \
|
|
114
|
+
--non-interactive
|
|
115
|
+
|
|
116
|
+
# Login with email/password
|
|
117
|
+
# Option 1: Use environment variables (recommended - avoids shell history)
|
|
118
|
+
export CLARY_CLI_EMAIL=demo@getclary.com
|
|
119
|
+
export CLARY_CLI_PASSWORD='your_password'
|
|
120
|
+
clary login http://localhost:3000
|
|
121
|
+
|
|
122
|
+
# Option 2: Interactive password prompt (password not in shell history)
|
|
123
|
+
clary login http://localhost:3000 --email demo@getclary.com
|
|
124
|
+
# You will be prompted to enter your password securely
|
|
125
|
+
|
|
126
|
+
# Deploy to existing project non-interactively
|
|
127
|
+
clary deploy \
|
|
128
|
+
--project-dir ./dbt \
|
|
129
|
+
--profiles-dir ./profiles \
|
|
130
|
+
--non-interactive
|
|
131
|
+
|
|
132
|
+
# Create new project non-interactively
|
|
133
|
+
clary deploy \
|
|
134
|
+
--create "My New Project" \
|
|
135
|
+
--assume-yes \
|
|
136
|
+
--non-interactive \
|
|
137
|
+
--project-dir ./dbt \
|
|
138
|
+
--profiles-dir ./profiles
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Behavior in Non-Interactive Mode
|
|
142
|
+
|
|
143
|
+
When `--non-interactive` is set (or `CI=true`):
|
|
144
|
+
- **Project selection**: Automatically selects the first available project
|
|
145
|
+
- **Confirmation prompts**: Fail with descriptive error unless `--assume-yes` is provided
|
|
146
|
+
- **OAuth login**: Not available - use `--token` or `--email` with `CLARY_CLI_PASSWORD` env var instead
|
|
147
|
+
|
|
148
|
+
### Email/Password Login
|
|
149
|
+
|
|
150
|
+
You can use email/password authentication with the CLI:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Option 1: Environment variables (recommended)
|
|
154
|
+
export CLARY_CLI_EMAIL=demo@getclary.com
|
|
155
|
+
export CLARY_CLI_PASSWORD='your_password'
|
|
156
|
+
clary login http://localhost:3000
|
|
157
|
+
|
|
158
|
+
# Option 2: Interactive password prompt
|
|
159
|
+
clary login http://localhost:3000 --email demo@getclary.com
|
|
160
|
+
# Password will be prompted securely (not visible in shell history)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Note**: For production CI/CD pipelines, consider using `--token` with a personal access token instead.
|
|
164
|
+
|
|
165
|
+
### Claude Code / Agentic Tools: Passwords with Special Characters
|
|
166
|
+
|
|
167
|
+
When using Claude Code or similar agentic coding tools, passwords containing special characters like `!` will fail with "Email and password not recognized" even when the credentials are correct.
|
|
168
|
+
|
|
169
|
+
**Why this happens**: Characters like `!` have special meaning in bash (history expansion). Even with single quotes, some shells still interpret them, causing the password to be mangled before it reaches the CLI.
|
|
170
|
+
|
|
171
|
+
**Solution**: Write the password to a file using a heredoc, which treats content as completely literal:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Write password to file using heredoc (bypasses all shell escaping)
|
|
175
|
+
cat > /tmp/clary_pass.txt << 'EOF'
|
|
176
|
+
your_password_with_special_chars!
|
|
177
|
+
EOF
|
|
178
|
+
|
|
179
|
+
# Set environment variables from the file
|
|
180
|
+
export CLARY_CLI_EMAIL=demo@getclary.com
|
|
181
|
+
export CLARY_CLI_PASSWORD=$(cat /tmp/clary_pass.txt)
|
|
182
|
+
|
|
183
|
+
# Login using environment variables
|
|
184
|
+
clary login http://localhost:3000 --non-interactive
|
|
185
|
+
|
|
186
|
+
# Clean up
|
|
187
|
+
rm /tmp/clary_pass.txt
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Important**: The `<< 'EOF'` syntax (with quotes around EOF) is critical - it prevents any shell interpretation of the content.
|
|
191
|
+
|
|
192
|
+
The CLI supports these environment variables for authentication:
|
|
193
|
+
|
|
194
|
+
| Variable | Description |
|
|
195
|
+
|----------|-------------|
|
|
196
|
+
| `CLARY_CLI_EMAIL` | Email for login (alternative to `--email`) |
|
|
197
|
+
| `CLARY_CLI_PASSWORD` | Password for email login (used with `--email`) |
|