itqan-cli 0.1.2__tar.gz → 0.2.0__tar.gz
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.
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/CHANGELOG.md +30 -0
- itqan_cli-0.2.0/PKG-INFO +405 -0
- itqan_cli-0.2.0/README.md +374 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/RELEASING.md +27 -4
- itqan_cli-0.2.0/dart/.gitignore +2 -0
- itqan_cli-0.2.0/dart/README.md +27 -0
- itqan_cli-0.2.0/dart/analysis_options.yaml +9 -0
- itqan_cli-0.2.0/dart/bin/itqan.dart +5 -0
- itqan_cli-0.2.0/dart/lib/itqan_cli.dart +5 -0
- itqan_cli-0.2.0/dart/lib/src/launcher.dart +172 -0
- itqan_cli-0.2.0/dart/lib/src/version.dart +3 -0
- itqan_cli-0.2.0/dart/pubspec.yaml +27 -0
- itqan_cli-0.2.0/dart/test/launcher_test.dart +143 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/pyproject.toml +1 -1
- itqan_cli-0.2.0/scripts/dart_package.py +49 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/downloader.py +28 -9
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/exceptions.py +4 -0
- itqan_cli-0.2.0/src/itqan_cli/flutter.py +184 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/main.py +32 -2
- itqan_cli-0.2.0/tests/test_dart_package.py +40 -0
- itqan_cli-0.2.0/tests/test_downloader.py +154 -0
- itqan_cli-0.2.0/tests/test_flutter.py +355 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_init.py +27 -0
- itqan_cli-0.1.2/PKG-INFO +0 -174
- itqan_cli-0.1.2/README.md +0 -143
- itqan_cli-0.1.2/tests/test_downloader.py +0 -76
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/.gitignore +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/LICENSE +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/npm/README.md +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/npm/bin/itqan.js +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/scripts/homebrew_formula.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/scripts/npm_packages.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/__init__.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/__main__.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/browse.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/client.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/credentials.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/init_template.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/lockfile.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/manifest.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/src/itqan_cli/semver.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/__init__.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/conftest.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_access.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_assets_dir.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_browse.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_cli_integration.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_client.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_entry_points.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_homebrew_formula.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_languages.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_lockfile.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_login.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_manifest.py +0 -0
- {itqan_cli-0.1.2 → itqan_cli-0.2.0}/tests/test_npm_packages.py +0 -0
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
## v0.2.0 (2026-10-12)
|
|
2
|
+
|
|
3
|
+
### Feat
|
|
4
|
+
|
|
5
|
+
- publish to pub.dev as `itqan_cli`: `dart pub global activate itqan_cli` installs `itqan` without
|
|
6
|
+
Python. It downloads the program for your computer on first use, checks it against the
|
|
7
|
+
release's `SHA256SUMS`, and keeps it for later runs.
|
|
8
|
+
- **flutter**: `itqan install --flutter` lists the installed asset folders under `flutter: assets:`
|
|
9
|
+
in `pubspec.yaml`, inside an `# itqan:start` / `# itqan:end` block. Later installs keep the block
|
|
10
|
+
in sync without the flag, and the rest of the file is never changed.
|
|
11
|
+
- **ci**: the [setup-itqan](https://github.com/Itqan-community/setup-itqan) GitHub Action installs
|
|
12
|
+
`itqan` on Linux, macOS and Windows runners: `uses: itqan-community/setup-itqan@v1`.
|
|
13
|
+
|
|
14
|
+
### Fix
|
|
15
|
+
|
|
16
|
+
- keep version markers out of the asset folders, where Flutter bundled them into apps. They now
|
|
17
|
+
live in `<assets_dir>/.itqan/`. Existing installs are moved over on the next `itqan install`
|
|
18
|
+
without downloading again.
|
|
19
|
+
|
|
20
|
+
### Docs
|
|
21
|
+
|
|
22
|
+
- rewrite the README around what you want to do: pick an install method for your project, get
|
|
23
|
+
started, use the assets in a web or Flutter app, update them, and set up CI.
|
|
24
|
+
|
|
25
|
+
## v0.1.3 (2026-10-11)
|
|
26
|
+
|
|
27
|
+
### Fix
|
|
28
|
+
|
|
29
|
+
- **release**: publish npm tarballs by ./ path
|
|
30
|
+
|
|
1
31
|
## v0.1.2 (2026-10-11)
|
|
2
32
|
|
|
3
33
|
### Feat
|
itqan_cli-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: itqan-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Itqan Quranic Asset Manager: install and pin Itqan Quranic assets in your project.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Itqan-community/itqan-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/Itqan-community/itqan-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/Itqan-community/itqan-cli/issues
|
|
8
|
+
Project-URL: Manifest format, https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md
|
|
9
|
+
Author: Itqan
|
|
10
|
+
Author-email: Hassaan Alansary <hassaanalansary@yahoo.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: assets,cli,itqan,mushaf,package-manager,quran,quranic,tafsir
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Religion
|
|
24
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: click>=8.1
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Requires-Dist: questionary>=2.1
|
|
29
|
+
Requires-Dist: requests>=2.31
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# itqan-cli
|
|
33
|
+
|
|
34
|
+
**Itqan Quranic Asset Manager**
|
|
35
|
+
|
|
36
|
+
`itqan` adds [Itqan](https://cms.itqan.dev) Quranic data, such as mushafs, tafsirs,
|
|
37
|
+
translations and fonts, to your app's project, the way npm or pub adds code libraries.
|
|
38
|
+
|
|
39
|
+
1. You list the assets you want, and which versions you accept, in `itqan-assets.yaml`.
|
|
40
|
+
2. `itqan install` downloads them into a folder in your project.
|
|
41
|
+
3. It records the exact versions it installed in `itqan-assets.lock`, so your teammates and your
|
|
42
|
+
CI get exactly the same files.
|
|
43
|
+
|
|
44
|
+
It works for any kind of project (web, React Native, Flutter, Python or anything else) on macOS,
|
|
45
|
+
Linux and Windows.
|
|
46
|
+
|
|
47
|
+
**Contents:** [Install](#install) · [Quick start](#quick-start) ·
|
|
48
|
+
[Use the assets in your app](#use-the-assets-in-your-app) · [The manifest](#the-manifest) ·
|
|
49
|
+
[Updating assets](#updating-assets) · [Assets that need access approval](#assets-that-need-access-approval) ·
|
|
50
|
+
[CI](#ci) · [Commands](#commands) · [Configuration](#configuration) ·
|
|
51
|
+
[Troubleshooting](#troubleshooting)
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
Pick the line for the tools you already have. Each one gives you the same `itqan` command.
|
|
56
|
+
|
|
57
|
+
| You work with | Install | Needs Python? |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| JavaScript, TypeScript, React Native | `npm install --save-dev itqan-cli` (or just `npx itqan-cli ...`) | No |
|
|
60
|
+
| Dart or Flutter | `dart pub global activate itqan_cli` | No |
|
|
61
|
+
| macOS or Linux, with Homebrew | `brew install itqan-community/tap/itqan` | No |
|
|
62
|
+
| Python 3.11 or newer | `pipx install itqan-cli` or `uv tool install itqan-cli` | Yes |
|
|
63
|
+
| GitHub Actions | `uses: itqan-community/setup-itqan@v1` (see [CI](#ci)) | No |
|
|
64
|
+
| None of these | [Download the program](#download-the-program-directly) | No |
|
|
65
|
+
|
|
66
|
+
Check that it works:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
itqan --version
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The options that don't need Python run a ready-made `itqan` program for your computer. It exists
|
|
73
|
+
for macOS (Apple Silicon and Intel), Linux (x86_64 and arm64, with glibc) and Windows (x86_64).
|
|
74
|
+
On any other system, such as Windows on ARM or Alpine Linux, install with Python.
|
|
75
|
+
|
|
76
|
+
### npm
|
|
77
|
+
|
|
78
|
+
Add it to your project, so everyone on the team gets the same version:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install --save-dev itqan-cli
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Then run it with `npx itqan ...`, or from a script in `package.json`:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"scripts": {
|
|
89
|
+
"assets": "itqan install"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
To try it without installing anything, use `npx itqan-cli init` and `npx itqan-cli install`.
|
|
95
|
+
|
|
96
|
+
### Dart and Flutter
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
dart pub global activate itqan_cli
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If `itqan` isn't found afterwards, add pub's folder to your `PATH`. `dart pub global activate`
|
|
103
|
+
prints the folder to add.
|
|
104
|
+
|
|
105
|
+
The package version is the CLI version: `dart pub global activate itqan_cli 0.2.0` gives you
|
|
106
|
+
itqan 0.2.0. The first time you run `itqan`, it downloads the program for your computer from the
|
|
107
|
+
[GitHub Release](https://github.com/Itqan-community/itqan-cli/releases), checks it against the
|
|
108
|
+
release's `SHA256SUMS` file, and keeps it for later runs.
|
|
109
|
+
|
|
110
|
+
### Homebrew
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
brew install itqan-community/tap/itqan
|
|
114
|
+
brew upgrade itqan # later, to update
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Python
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pipx install itqan-cli # or: uv tool install itqan-cli
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This installs `itqan`, and the same command again under the name `itqan-cli`.
|
|
124
|
+
|
|
125
|
+
### Download the program directly
|
|
126
|
+
|
|
127
|
+
Each [GitHub Release](https://github.com/Itqan-community/itqan-cli/releases) has the program for
|
|
128
|
+
each system, named `itqan-<version>-<os>-<arch>` (with `.exe` on Windows), and a `SHA256SUMS`
|
|
129
|
+
file to check it with. Download yours, check it, and put it on your `PATH` as `itqan`. On an Apple
|
|
130
|
+
Silicon Mac, for example:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
v=0.2.0 # the release you want
|
|
134
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/itqan-$v-macos-arm64"
|
|
135
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/SHA256SUMS"
|
|
136
|
+
shasum -a 256 --check --ignore-missing SHA256SUMS # Linux: sha256sum --check --ignore-missing SHA256SUMS
|
|
137
|
+
chmod +x "itqan-$v-macos-arm64"
|
|
138
|
+
sudo mv "itqan-$v-macos-arm64" /usr/local/bin/itqan
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
On Windows, download `itqan-<version>-windows-x86_64.exe`, rename it to `itqan.exe`, and put it in
|
|
142
|
+
a folder on your `PATH`.
|
|
143
|
+
|
|
144
|
+
## Quick start
|
|
145
|
+
|
|
146
|
+
Run these in your project's folder:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
itqan init # 1. create itqan-assets.yaml, with a few real assets as examples
|
|
150
|
+
itqan browse # 2. optional: search the catalog and add the assets you want
|
|
151
|
+
itqan install # 3. download them and write itqan-assets.lock
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
You now have:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
your-project/
|
|
158
|
+
├── itqan-assets.yaml # what you asked for: edit this, and commit it
|
|
159
|
+
├── itqan-assets.lock # what was installed: don't edit it, but commit it
|
|
160
|
+
└── assets/
|
|
161
|
+
├── english-translation/
|
|
162
|
+
│ └── tr-ab-en_hilali.csv
|
|
163
|
+
├── tafsir-jalalayn/
|
|
164
|
+
│ └── ...
|
|
165
|
+
└── .itqan/ # the CLI's own bookkeeping, not part of any asset
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Commit `itqan-assets.yaml` and `itqan-assets.lock`. You can commit the `assets/` folder too, or
|
|
169
|
+
add it to `.gitignore` and run `itqan install` after cloning (and in CI), which downloads exactly
|
|
170
|
+
the versions in the lockfile.
|
|
171
|
+
|
|
172
|
+
In `itqan browse`, type to filter the list, press Enter to add the highlighted asset, or press
|
|
173
|
+
Space on several and then Enter. `itqan browse tafsir` starts with a search, and
|
|
174
|
+
`itqan browse --category translation` shows one kind of asset.
|
|
175
|
+
|
|
176
|
+
## Use the assets in your app
|
|
177
|
+
|
|
178
|
+
Each asset goes into its own folder, `<assets_dir>/<entry name>/`. `assets_dir` is `assets` unless
|
|
179
|
+
your manifest says otherwise (see [The manifest](#the-manifest)). Point it at the folder your
|
|
180
|
+
framework already serves or bundles.
|
|
181
|
+
|
|
182
|
+
### Web apps (Vite, Next.js, Create React App, and others)
|
|
183
|
+
|
|
184
|
+
Install into the `public/` folder, which these tools serve as-is:
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
# itqan-assets.yaml
|
|
188
|
+
assets_dir: "public/quran"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The files are then served from `/quran/`:
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
const csv = await fetch("/quran/english-translation/tr-ab-en_hilali.csv").then((r) => r.text());
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Flutter
|
|
198
|
+
|
|
199
|
+
Flutter only bundles the folders listed in `pubspec.yaml`, and listing a folder doesn't include
|
|
200
|
+
its subfolders. `itqan` can keep that list for you. Put `itqan-assets.yaml` next to
|
|
201
|
+
`pubspec.yaml`, and install once with `--flutter`:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
itqan install --flutter
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
This adds every folder with installed files to `flutter: assets:`, inside a block that `itqan`
|
|
208
|
+
manages:
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
flutter:
|
|
212
|
+
assets:
|
|
213
|
+
- images/ # your own entries are left alone
|
|
214
|
+
# itqan:start (managed by `itqan install`, do not edit)
|
|
215
|
+
- assets/english-translation/
|
|
216
|
+
- assets/tafsir-jalalayn/
|
|
217
|
+
# itqan:end
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Commit `pubspec.yaml` with the block. From then on, every `itqan install` (yours, a teammate's,
|
|
221
|
+
CI's) keeps the block in step with the manifest, with no flag needed. Nothing else in
|
|
222
|
+
`pubspec.yaml` is changed, and the file isn't touched at all when nothing changed. Load the files
|
|
223
|
+
with `rootBundle`:
|
|
224
|
+
|
|
225
|
+
```dart
|
|
226
|
+
import 'package:flutter/services.dart';
|
|
227
|
+
|
|
228
|
+
final csv = await rootBundle.loadString('assets/english-translation/tr-ab-en_hilali.csv');
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
To stop, delete the block, including both marker lines. To skip it for one run, pass
|
|
232
|
+
`--no-flutter`.
|
|
233
|
+
|
|
234
|
+
### React Native, Python and everything else
|
|
235
|
+
|
|
236
|
+
The assets are plain files in `<assets_dir>/<entry name>/`. Read them, bundle them or copy them
|
|
237
|
+
the way your platform handles any other data file.
|
|
238
|
+
|
|
239
|
+
## The manifest
|
|
240
|
+
|
|
241
|
+
`itqan-assets.yaml` lists the assets you want. `itqan init` writes one for you, with comments
|
|
242
|
+
explaining each part. A fuller example:
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
schema_version: 1
|
|
246
|
+
|
|
247
|
+
# Where to download the assets, relative to this file. Optional, defaults to "assets".
|
|
248
|
+
assets_dir: "public/quran"
|
|
249
|
+
|
|
250
|
+
assets:
|
|
251
|
+
# The entry's name is the asset's name in the catalog (as `itqan browse` shows it).
|
|
252
|
+
tafsir-jalalayn:
|
|
253
|
+
version: "^2.0.0"
|
|
254
|
+
|
|
255
|
+
# The same asset in English. Each language is its own entry with its own folder, so it needs its
|
|
256
|
+
# own name and has to say which asset it is.
|
|
257
|
+
tafsir-jalalayn-en:
|
|
258
|
+
asset: tafsir-jalalayn
|
|
259
|
+
language: en
|
|
260
|
+
version: "~1.3"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Which versions an entry accepts:
|
|
264
|
+
|
|
265
|
+
| `version:` | Accepts | Example |
|
|
266
|
+
|---|---|---|
|
|
267
|
+
| `"^2.1.0"` | any newer version that keeps the same first number | 2.1.0, 2.4.3, not 3.0.0 |
|
|
268
|
+
| `"~2.1"` | only fixes to 2.1 | 2.1.0, 2.1.7, not 2.2.0 |
|
|
269
|
+
| `"2.1.0"` | exactly this version | 2.1.0 only |
|
|
270
|
+
|
|
271
|
+
Use `^` unless you have a reason not to. A publisher changes the first number when an update
|
|
272
|
+
could break apps that use the asset. Below 1.0 the second number plays that role, so `"^0.3.0"`
|
|
273
|
+
accepts 0.3.x only.
|
|
274
|
+
|
|
275
|
+
Each language of an asset has its own version history. That's why `tafsir-jalalayn` above is on
|
|
276
|
+
2.x while its English translation is on 1.3.x. Leave out `language` to get the asset's original
|
|
277
|
+
language.
|
|
278
|
+
|
|
279
|
+
The full format, including every rule and error, is specified in
|
|
280
|
+
[ASSET_MANIFEST.md](https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md).
|
|
281
|
+
|
|
282
|
+
## Updating assets
|
|
283
|
+
|
|
284
|
+
- **Add or remove an asset, or change a `version:` range:** edit `itqan-assets.yaml` and run
|
|
285
|
+
`itqan install`. It sees that the lockfile no longer matches the manifest, picks the newest
|
|
286
|
+
versions the manifest allows, and rewrites the lockfile.
|
|
287
|
+
- **Get newer versions within the ranges you already have:** `itqan install --force`.
|
|
288
|
+
- **Install what the lockfile says, for example after cloning or in CI:** `itqan install`.
|
|
289
|
+
|
|
290
|
+
`itqan install` writes the lockfile only after every download succeeded, so a failed install
|
|
291
|
+
never leaves a lockfile that doesn't match your files.
|
|
292
|
+
|
|
293
|
+
## Assets that need access approval
|
|
294
|
+
|
|
295
|
+
Some publishers approve each developer before their assets can be downloaded.
|
|
296
|
+
|
|
297
|
+
1. `itqan browse` lists these assets too, marked `request access`, `access pending` or
|
|
298
|
+
`access rejected`, with a link to the asset's page on cms.itqan.dev. Request access there.
|
|
299
|
+
2. Once you're approved, create an API key at
|
|
300
|
+
[cms.itqan.dev/account/api-keys](https://cms.itqan.dev/account/api-keys) and save it:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
itqan login
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
3. The asset now shows as `granted` in `itqan browse`, and `itqan install` can download it.
|
|
307
|
+
|
|
308
|
+
If `itqan install` hits an asset you can't download yet, it says which one and where to request
|
|
309
|
+
access. In CI, pass the key in the `ITQAN_API_KEY` environment variable instead of
|
|
310
|
+
`itqan login`.
|
|
311
|
+
|
|
312
|
+
## CI
|
|
313
|
+
|
|
314
|
+
Run `itqan install` in CI to download the exact versions in `itqan-assets.lock`. On a pull
|
|
315
|
+
request that updates an asset, this also checks that the new version installs.
|
|
316
|
+
|
|
317
|
+
### GitHub Actions
|
|
318
|
+
|
|
319
|
+
The [setup-itqan](https://github.com/Itqan-community/setup-itqan) action installs `itqan` on
|
|
320
|
+
Linux, macOS and Windows runners:
|
|
321
|
+
|
|
322
|
+
```yaml
|
|
323
|
+
steps:
|
|
324
|
+
- uses: actions/checkout@v7
|
|
325
|
+
- uses: itqan-community/setup-itqan@v1
|
|
326
|
+
with:
|
|
327
|
+
version: latest # or a fixed version, such as 0.2.0
|
|
328
|
+
- run: itqan install
|
|
329
|
+
env:
|
|
330
|
+
ITQAN_API_KEY: ${{ secrets.ITQAN_API_KEY }} # only needed for assets that need access approval
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Pass `install: true` to have the action run `itqan install` itself. The
|
|
334
|
+
[action's README](https://github.com/Itqan-community/setup-itqan#readme) lists all its options.
|
|
335
|
+
|
|
336
|
+
### Other CI systems
|
|
337
|
+
|
|
338
|
+
Install `itqan` with whichever method from [Install](#install) suits your build image. For
|
|
339
|
+
example, `npm ci` for a project with `itqan-cli` in its `devDependencies`, or
|
|
340
|
+
`pipx install itqan-cli`. Then run `itqan install`, with `ITQAN_API_KEY` set if you need it.
|
|
341
|
+
|
|
342
|
+
## Commands
|
|
343
|
+
|
|
344
|
+
| Command | What it does |
|
|
345
|
+
|---|---|
|
|
346
|
+
| `itqan init` | Create `itqan-assets.yaml` with a few assets from the catalog, or commented examples when offline. `--assets-dir` sets where assets go; `--force` overwrites an existing manifest. |
|
|
347
|
+
| `itqan browse [SEARCH]` | Search the catalog, pick assets, add them to `itqan-assets.yaml` (created if missing), and optionally install them. `--category` limits it to one kind of asset; `--no-interactive` prints a table (the default when not in a terminal); `--json` prints JSON. |
|
|
348
|
+
| `itqan install` | Download the assets and write `itqan-assets.lock`. Uses the lockfile's exact versions while it matches the manifest. `--force` picks the newest allowed versions and downloads again. `--flutter` keeps `pubspec.yaml` up to date (see [Flutter](#flutter)). `--assets-dir` overrides the manifest's folder for one run. |
|
|
349
|
+
| `itqan sync` | Same as `itqan install`. |
|
|
350
|
+
| `itqan login` | Save your API key for the registry, after checking it. `--api-key` passes the key without the prompt. |
|
|
351
|
+
| `itqan logout` | Remove the saved key. |
|
|
352
|
+
| `itqan --version` | Print the CLI version. |
|
|
353
|
+
|
|
354
|
+
Add `--help` to any command for all its options. `install` and `browse` read the manifest from
|
|
355
|
+
`itqan-assets.yaml` in the current folder; `--manifest` (or `-m`) points them elsewhere.
|
|
356
|
+
|
|
357
|
+
## Configuration
|
|
358
|
+
|
|
359
|
+
| Option | Environment variable | Default |
|
|
360
|
+
|---|---|---|
|
|
361
|
+
| `--api-key` | `ITQAN_API_KEY` | The key saved by `itqan login`, if any. |
|
|
362
|
+
| `--registry-url` | `ITQAN_REGISTRY_URL` | `https://api.cms.itqan.dev`, the public registry. |
|
|
363
|
+
| | `ITQAN_CONFIG_DIR` | Where `itqan login` saves keys: `~/.config/itqan` (`%APPDATA%\itqan` on Windows). |
|
|
364
|
+
| | `ITQAN_CACHE_DIR` | Dart package only. Where the downloaded program is kept: `~/Library/Caches/itqan` (macOS), `~/.cache/itqan` (Linux), `%LOCALAPPDATA%\itqan` (Windows). |
|
|
365
|
+
| | `ITQAN_CLI_DOWNLOAD_URL` | Dart package only. A folder (`https://` or `file://`) with a release's programs and `SHA256SUMS`, such as a mirror, used instead of the GitHub Release. |
|
|
366
|
+
|
|
367
|
+
A key passed with `--api-key` or `ITQAN_API_KEY` is used instead of the saved one. The saved key
|
|
368
|
+
file is readable only by you.
|
|
369
|
+
|
|
370
|
+
## Troubleshooting
|
|
371
|
+
|
|
372
|
+
**"command not found: itqan".** The folder `itqan` was installed into isn't on your `PATH`. For
|
|
373
|
+
pipx, run `pipx ensurepath`. For Dart, add the folder `dart pub global activate` printed. For npm,
|
|
374
|
+
run it through `npx itqan`.
|
|
375
|
+
|
|
376
|
+
**macOS says the program can't be opened.** Programs downloaded with a browser are blocked
|
|
377
|
+
because they aren't notarized by Apple. Allow it with
|
|
378
|
+
`xattr -d com.apple.quarantine /usr/local/bin/itqan`. Downloads made with `curl`, Homebrew, npm
|
|
379
|
+
or Dart aren't affected.
|
|
380
|
+
|
|
381
|
+
**npm: "@itqan-community/cli-... is not installed".** npm installs the program for your computer
|
|
382
|
+
as an optional dependency of `itqan-cli`. Reinstall without `--omit=optional` or
|
|
383
|
+
`--no-optional`.
|
|
384
|
+
|
|
385
|
+
**"There is no itqan binary for ..." or "no prebuilt binary".** Your system isn't one of those
|
|
386
|
+
listed under [Install](#install). Install with Python instead: `pipx install itqan-cli`.
|
|
387
|
+
|
|
388
|
+
**`itqan install` says an asset needs access, or returns 401 or 403.** See
|
|
389
|
+
[Assets that need access approval](#assets-that-need-access-approval). In CI, check that
|
|
390
|
+
`ITQAN_API_KEY` is set.
|
|
391
|
+
|
|
392
|
+
**Flutter: "Unable to load asset".** Make sure the manifest sits next to `pubspec.yaml`, run
|
|
393
|
+
`itqan install --flutter`, and then restart the app fully. Hot reload doesn't pick up new assets.
|
|
394
|
+
|
|
395
|
+
## Development
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
uv sync
|
|
399
|
+
uv run pytest
|
|
400
|
+
uv build
|
|
401
|
+
uv run --group binary pyinstaller --onefile --name itqan --copy-metadata itqan-cli --specpath build src/itqan_cli/__main__.py # dist/itqan
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
The npm package is built from [npm/](npm) and the pub.dev package lives in [dart/](dart) (tested
|
|
405
|
+
with `dart test`). Releases are published from version tags; see [RELEASING.md](RELEASING.md).
|