indraq_cli 1.3.0 → 1.5.1

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.
Files changed (86) hide show
  1. package/README.md +1031 -662
  2. package/dist/cli/create-program.d.ts.map +1 -1
  3. package/dist/cli/create-program.js +6 -6
  4. package/dist/cli/create-program.js.map +1 -1
  5. package/dist/cli/doctor.command.d.ts.map +1 -1
  6. package/dist/cli/doctor.command.js +23 -0
  7. package/dist/cli/doctor.command.js.map +1 -1
  8. package/dist/modules/configure/configure.command.d.ts.map +1 -0
  9. package/dist/modules/configure/configure.command.js +116 -0
  10. package/dist/modules/configure/configure.command.js.map +1 -0
  11. package/dist/modules/deploy/commands/build.command.d.ts +2 -2
  12. package/dist/modules/deploy/commands/build.command.d.ts.map +1 -1
  13. package/dist/modules/deploy/commands/build.command.js +45 -16
  14. package/dist/modules/deploy/commands/build.command.js.map +1 -1
  15. package/dist/modules/deploy/commands/configure-docker.command.d.ts +2 -0
  16. package/dist/modules/deploy/commands/configure-docker.command.d.ts.map +1 -0
  17. package/dist/modules/deploy/commands/configure-docker.command.js +169 -0
  18. package/dist/modules/deploy/commands/configure-docker.command.js.map +1 -0
  19. package/dist/modules/deploy/config/docker-config.d.ts +21 -0
  20. package/dist/modules/deploy/config/docker-config.d.ts.map +1 -0
  21. package/dist/modules/deploy/config/docker-config.js +187 -0
  22. package/dist/modules/deploy/config/docker-config.js.map +1 -0
  23. package/dist/modules/deploy/index.d.ts.map +1 -1
  24. package/dist/modules/deploy/index.js +9 -26
  25. package/dist/modules/deploy/index.js.map +1 -1
  26. package/dist/modules/mobile/commands/build-mobile.command.d.ts +11 -0
  27. package/dist/modules/mobile/commands/build-mobile.command.d.ts.map +1 -0
  28. package/dist/modules/mobile/commands/build-mobile.command.js +188 -0
  29. package/dist/modules/mobile/commands/build-mobile.command.js.map +1 -0
  30. package/dist/modules/mobile/commands/configure-mobile.command.d.ts +8 -0
  31. package/dist/modules/mobile/commands/configure-mobile.command.d.ts.map +1 -0
  32. package/dist/modules/mobile/commands/configure-mobile.command.js +353 -0
  33. package/dist/modules/mobile/commands/configure-mobile.command.js.map +1 -0
  34. package/dist/modules/mobile/config/mobile-config.d.ts +43 -0
  35. package/dist/modules/mobile/config/mobile-config.d.ts.map +1 -0
  36. package/dist/modules/mobile/config/mobile-config.js +211 -0
  37. package/dist/modules/mobile/config/mobile-config.js.map +1 -0
  38. package/dist/modules/mobile/index.d.ts +3 -0
  39. package/dist/modules/mobile/index.d.ts.map +1 -0
  40. package/dist/modules/mobile/index.js +50 -0
  41. package/dist/modules/mobile/index.js.map +1 -0
  42. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts +31 -0
  43. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts.map +1 -0
  44. package/dist/modules/mobile/services/jenkins-mobile.service.js +175 -0
  45. package/dist/modules/mobile/services/jenkins-mobile.service.js.map +1 -0
  46. package/dist/modules/mobile/services/project.service.d.ts +11 -0
  47. package/dist/modules/mobile/services/project.service.d.ts.map +1 -0
  48. package/dist/modules/mobile/services/project.service.js +73 -0
  49. package/dist/modules/mobile/services/project.service.js.map +1 -0
  50. package/dist/modules/mobile/services/source-bundle.service.d.ts +9 -0
  51. package/dist/modules/mobile/services/source-bundle.service.d.ts.map +1 -0
  52. package/dist/modules/mobile/services/source-bundle.service.js +114 -0
  53. package/dist/modules/mobile/services/source-bundle.service.js.map +1 -0
  54. package/dist/modules/mobile/services/version-sync.service.d.ts +7 -0
  55. package/dist/modules/mobile/services/version-sync.service.d.ts.map +1 -0
  56. package/dist/modules/mobile/services/version-sync.service.js +88 -0
  57. package/dist/modules/mobile/services/version-sync.service.js.map +1 -0
  58. package/dist/shared/config/config-files.d.ts +5 -0
  59. package/dist/shared/config/config-files.d.ts.map +1 -0
  60. package/dist/shared/config/config-files.js +88 -0
  61. package/dist/shared/config/config-files.js.map +1 -0
  62. package/dist/shared/config/jenkins-config.d.ts +36 -0
  63. package/dist/shared/config/jenkins-config.d.ts.map +1 -0
  64. package/dist/shared/config/jenkins-config.js +164 -0
  65. package/dist/shared/config/jenkins-config.js.map +1 -0
  66. package/dist/shared/jenkins/configure-jenkins.d.ts +7 -0
  67. package/dist/shared/jenkins/configure-jenkins.d.ts.map +1 -0
  68. package/dist/shared/jenkins/configure-jenkins.js +84 -0
  69. package/dist/shared/jenkins/configure-jenkins.js.map +1 -0
  70. package/dist/{modules/deploy/services → shared/jenkins}/jenkins.service.d.ts +5 -4
  71. package/dist/shared/jenkins/jenkins.service.d.ts.map +1 -0
  72. package/dist/{modules/deploy/services → shared/jenkins}/jenkins.service.js +43 -89
  73. package/dist/shared/jenkins/jenkins.service.js.map +1 -0
  74. package/dist/shared/runtime/runtime-doctor.js.map +1 -1
  75. package/package.json +10 -5
  76. package/templates/jenkins/Jenkinsfile-Mobile-App +633 -0
  77. package/dist/modules/deploy/commands/configure.command.d.ts.map +0 -1
  78. package/dist/modules/deploy/commands/configure.command.js +0 -404
  79. package/dist/modules/deploy/commands/configure.command.js.map +0 -1
  80. package/dist/modules/deploy/config/deployment-config.d.ts +0 -29
  81. package/dist/modules/deploy/config/deployment-config.d.ts.map +0 -1
  82. package/dist/modules/deploy/config/deployment-config.js +0 -164
  83. package/dist/modules/deploy/config/deployment-config.js.map +0 -1
  84. package/dist/modules/deploy/services/jenkins.service.d.ts.map +0 -1
  85. package/dist/modules/deploy/services/jenkins.service.js.map +0 -1
  86. /package/dist/modules/{deploy/commands → configure}/configure.command.d.ts +0 -0
package/README.md CHANGED
@@ -9,413 +9,430 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- Build Docker images · Push to GHCR · Run Jenkins pipelines · Stream deployment logs
12
+ Docker & GHCR deployments · Jenkins automation · Expo / React Native Android builds · Live terminal logs
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
- <img alt="Node 24" src="https://img.shields.io/badge/Node.js-24.x-339933?logo=node.js&logoColor=white" />
17
- <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" />
18
16
  <img alt="npm" src="https://img.shields.io/npm/v/indraq_cli?logo=npm&label=npm" />
17
+ <img alt="Node 22+" src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=node.js&logoColor=white" />
18
+ <img alt="Java 21" src="https://img.shields.io/badge/Java-21%20recommended-ED8B00?logo=openjdk&logoColor=white" />
19
+ <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" />
19
20
  <img alt="License" src="https://img.shields.io/npm/l/indraq_cli" />
20
- <img alt="Version" src="https://img.shields.io/badge/version-1.3.0-264B63" />
21
+ <img alt="Version" src="https://img.shields.io/badge/version-1.5.1-264B63" />
21
22
  </p>
22
23
 
23
24
  > [!IMPORTANT]
24
- > **IndraQ CLI is built for IndraQ Innovations engineering operations and is publicly distributed on npm.** Anyone can install and use it with compatible Docker, GitHub/GHCR, and Jenkins infrastructure. The deployment module is the first module; more tools can be added without turning the project into one giant script.
25
+ > **IndraQ CLI is an engineering operations CLI created by IndraQ Innovations.** It is publicly installable from npm. The tool is designed so new internal capabilities can be added as separate modules instead of growing into one giant script.
25
26
 
26
27
  ---
27
28
 
28
29
  ## Index
29
30
 
30
- 1. [What are we building?](#what-are-we-building)
31
+ 1. [What is IndraQ CLI?](#what-is-indraq-cli)
31
32
  2. [Explain it like I am new](#explain-it-like-i-am-new)
32
- 3. [What happens during deployment?](#what-happens-during-deployment)
33
+ 3. [What changed in v1.5.1?](#what-changed-in-v151)
33
34
  4. [Requirements](#requirements)
34
35
  5. [Install Java 21](#install-java-21)
35
- 6. [Install the CLI](#install-the-cli)
36
- 7. [First-time configuration](#first-time-configuration)
37
- 8. [Change configuration later](#change-configuration-later)
38
- 9. [Deploy development](#deploy-development)
39
- 10. [Deploy production](#deploy-production)
40
- 11. [Jenkins setup and rules](#jenkins-setup-and-rules)
41
- 12. [GitHub and GHCR](#github-and-ghcr)
42
- 13. [Where configuration and secrets live](#where-configuration-and-secrets-live)
43
- 14. [Command reference](#command-reference)
44
- 15. [Project architecture](#project-architecture)
45
- 16. [Common errors](#common-errors)
46
- 17. [Frequently asked questions](#frequently-asked-questions)
47
- 18. [Final checklist](#final-checklist)
48
- 19. [Future modules](#future-modules)
49
- 20. [Publishing and npm organization management](#publishing-and-npm-organization-management)
50
- 21. [License](#license)
36
+ 6. [Install IndraQ CLI](#install-indraq-cli)
37
+ 7. [Run the doctor](#run-the-doctor)
38
+ 8. [Configuration home](#configuration-home)
39
+ 9. [Configure Jenkins](#configure-jenkins)
40
+ 10. [Configure Docker / GHCR](#configure-docker--ghcr)
41
+ 11. [Configure Mobile App](#configure-mobile-app)
42
+ 12. [Docker deployment](#docker-deployment)
43
+ 13. [Mobile build overview](#mobile-build-overview)
44
+ 14. [Mobile build matrix](#mobile-build-matrix)
45
+ 15. [Mobile build commands](#mobile-build-commands)
46
+ 16. [Mobile build flags](#mobile-build-flags)
47
+ 17. [Android versioning and artifact names](#android-versioning-and-artifact-names)
48
+ 18. [How local source reaches Jenkins](#how-local-source-reaches-jenkins)
49
+ 19. [Root .env behavior](#root-env-behavior)
50
+ 20. [Mobile Jenkins setup](#mobile-jenkins-setup)
51
+ 21. [Configuration and secret storage](#configuration-and-secret-storage)
52
+ 22. [Upgrade from v1.4 / v1.5](#upgrade-from-v14--v15)
53
+ 23. [Command reference](#command-reference)
54
+ 24. [Troubleshooting](#troubleshooting)
55
+ 25. [Frequently asked questions](#frequently-asked-questions)
56
+ 26. [Project architecture](#project-architecture)
57
+ 27. [Final checklist](#final-checklist)
58
+ 28. [License](#license)
51
59
 
52
60
  ---
53
61
 
54
- ## What are we building?
62
+ ## What is IndraQ CLI?
55
63
 
56
- IndraQ CLI is a small program that runs inside your terminal. Instead of remembering many Docker, GitHub, GHCR, and Jenkins commands, you tell **IndraQ CLI what you want**, and it performs the boring steps for you.
64
+ IndraQ CLI is a program you install once on a developer computer and then use from **any project folder**.
57
65
 
58
- Today it handles deployment:
66
+ Instead of remembering many Docker, GitHub, Jenkins, Android, and build commands, you run a small IndraQ command such as:
59
67
 
60
- ```text
61
- Your project
62
-
63
- ├── Dockerfile
64
-
65
- └── indraq deploy:dev
66
-
67
- ├── check Docker / GitHub / Java / Jenkins
68
- ├── build Docker image
69
- ├── push image to GHCR
70
- ├── find matching Jenkins job
71
- ├── start Jenkins build
72
- └── show Jenkins logs in this terminal
68
+ ```bash
69
+ indraq deploy:dev
73
70
  ```
74
71
 
75
- The goal is not to make one huge deployment script. The goal is to build a **modular engineering CLI platform** where future commands can live beside deployment cleanly.
76
-
77
- ---
72
+ or:
78
73
 
79
- ## Explain it like I am new
74
+ ```bash
75
+ indraq build mobile:staging
76
+ ```
80
77
 
81
- Imagine you made a school project and want to put the new version on a server.
78
+ The CLI validates the request, uses the saved configuration for the current project, performs the work, and shows failures directly in the same VS Code terminal.
82
79
 
83
- Without IndraQ CLI, you may need to remember a long list of commands: build an image, log in to GitHub's registry, push the image, open Jenkins, find the correct pipeline, start it, and then watch the logs.
80
+ ### One installation, many projects
84
81
 
85
- With IndraQ CLI, after one-time setup you type:
82
+ Install globally once:
86
83
 
87
84
  ```bash
88
- indraq deploy:dev
85
+ npm install -g indraq_cli
89
86
  ```
90
87
 
91
- The CLI does the sequence for you. If something is wrong, it stops and tells you what is wrong instead of silently continuing.
88
+ Then use it anywhere:
92
89
 
93
- ### The three names you should remember
90
+ ```text
91
+ C:\Projects\accounting-service> indraq deploy:dev
92
+ C:\Projects\mobile-app> indraq build mobile:dev
93
+ C:\Projects\another-app> indraq configure
94
+ ```
94
95
 
95
- | Thing | Simple meaning |
96
- |---|---|
97
- | **Docker image** | A packaged copy of your application |
98
- | **GHCR** | GitHub's place for storing Docker images |
99
- | **Jenkins pipeline/job** | The automation that deploys or processes your image |
96
+ Each project keeps its own `.indraq/` configuration. The CLI itself is not installed separately in every project.
100
97
 
101
98
  ---
102
99
 
103
- ## What happens during deployment?
100
+ ## Explain it like I am new
104
101
 
105
- ```mermaid
106
- flowchart TD
107
- A[indraq deploy:dev / deploy:prod] --> B{Configuration exists?}
108
- B -- No --> C[Stop: run indraq configure]
109
- B -- Yes --> D[Check Docker, GitHub, Java and Jenkins]
110
- D --> E{Jenkins job exists?}
111
- E -- No --> F[Stop with clear error]
112
- E -- Yes --> G[Ask for Docker tag]
113
- G --> H[Build Docker image]
114
- H --> I[Authenticate to GHCR]
115
- I --> J[Push image to GHCR]
116
- J --> K[Run Jenkins CLI build]
117
- K --> L[Stream Jenkins console output]
118
- L --> M{Pipeline result}
119
- M -- Failed --> N[Return failure and keep logs visible]
120
- M -- Success --> O[Deployment complete]
121
- ```
122
-
123
- The Jenkins job name is intentionally simple:
124
-
125
- > **Jenkins job name = configured image name**
102
+ Imagine you built a school project.
126
103
 
127
- Example:
104
+ You have the project files on your computer. You want another computer called **Jenkins** to build or deploy them for you.
128
105
 
129
- ```text
130
- Image name: immortality-accounting-service
131
- Expected Jenkins job: immortality-accounting-service
132
- GHCR image: ghcr.io/indraq-innovations/immortality-accounting-service
133
- ```
106
+ Without IndraQ CLI, you may need to:
134
107
 
135
- If Jenkins does not contain that job, deployment stops before building the Docker image.
108
+ 1. remember many commands;
109
+ 2. open Jenkins in the browser;
110
+ 3. choose the correct job;
111
+ 4. fill many parameters;
112
+ 5. copy environment variables;
113
+ 6. wait for the build;
114
+ 7. keep refreshing logs.
136
115
 
137
- ---
116
+ With IndraQ CLI, you configure the project once and later type one command.
138
117
 
139
- ## Requirements
118
+ For a mobile app:
140
119
 
141
- Install these before using the deployment module.
120
+ ```text
121
+ Your VS Code project
122
+
123
+ │ indraq build mobile:prod
124
+
125
+ IndraQ CLI
126
+
127
+ ├── checks you are at the project root
128
+ ├── validates Expo / React Native
129
+ ├── reads the saved Production settings
130
+ ├── reads root .env automatically
131
+ ├── creates a clean source snapshot
132
+ ├── sends it to Production Jenkins
133
+ └── shows Jenkins logs here
134
+
135
+
136
+ Production Jenkins
137
+
138
+ ├── installs dependencies
139
+ ├── prepares Android
140
+ ├── builds APK/AAB
141
+ └── publishes the artifact
142
+ ```
143
+
144
+ You do **not** need to give Jenkins a Git URL, Git branch, app subdirectory, or pasted `.env` content for this mobile workflow.
142
145
 
143
- | Requirement | Why it is needed | Quick check |
144
- |---|---|---|
145
- | **Node.js 24** | Runs IndraQ CLI | `node --version` |
146
- | **npm** | Installs the CLI | `npm --version` |
147
- | **Git** | Detects your GitHub authentication | `git --version` |
148
- | **Docker** | Builds and pushes images | `docker --version` |
149
- | **Java** | Runs `jenkins-cli.jar` | `java -version` |
150
- | **Jenkins account** | Starts your pipeline | Jenkins username + API token/password |
146
+ ---
151
147
 
152
- > [!TIP]
153
- > Jenkins accepts passwords for the CLI in many configurations, but an **API token is strongly preferred**. Treat the prompt `API token or password` as "paste your Jenkins API token here" whenever possible.
148
+ ## What changed in v1.5.1?
154
149
 
155
- ### Java is not optional
150
+ v1.5.1 keeps the Android versioning introduced in v1.5 and hardens the Jenkins/Git workflow around it.
156
151
 
157
- Jenkins provides its CLI as a Java `.jar` file. IndraQ CLI downloads that file from your Jenkins server, so your computer must be able to run:
152
+ This patch fixes the mobile Jenkinsfile Groovy escaping error, makes the mobile Jenkins job name deterministic, makes project configuration Git-shareable, keeps Jenkins login credentials machine-local, and makes Docker deployments send the exact manual deployment parameters expected by the Jenkins pipeline.
158
153
 
159
- ```bash
160
- java -version
161
- ```
162
-
163
- If that command is not found, **do not continue to `indraq configure` yet**. Install Java first using the next section.
164
-
165
- > [!IMPORTANT]
166
- > **IndraQ standard: Java 21 LTS.** Jenkins applies its Java support policy to CLI clients as well as controllers and agents. Standardizing every IndraQ developer machine on Java 21 avoids different developers running different Java versions.
154
+ ### Jenkins/Git behavior hardened in v1.5.1
167
155
 
168
- ---
156
+ - Mobile always targets the Jenkins job **`Mobile app Cli build`**. The job name is no longer configurable per project.
157
+ - The mobile Jenkinsfile no longer contains the Groovy-invalid escaped-dot expression that caused `unexpected char: '\'` during pipeline compilation.
158
+ - `.indraq/mobile.json`, `.indraq/docker.json`, and `.indraq/jenkins.json` are intended to be committed to Git.
159
+ - `.indraq/jenkins.local.json`, Jenkins username/token/password, `.env`, and `jenkins-cli.jar` are machine-local and never meant to be committed.
160
+ - Docker CLI deployments now start Jenkins with `ACTION=DEPLOY`, `IMAGE_TAG`, optional `IMAGE_DIGEST`, and `DEPLOYMENT_SOURCE=INDRAQ_CLI`.
161
+ - Expo versions are synchronized to `app.json` when possible. React Native CLI versions are synchronized to `android/app/build.gradle` / `build.gradle.kts` when those values are simple literals. Jenkins still enforces the requested version during the actual Android build.
169
162
 
170
- ## Install Java 21
163
+ ### App name is now part of Mobile configuration
171
164
 
172
- You only need to do this once on each developer machine.
165
+ Every mobile project stores an app name. IndraQ uses this name when it creates the final APK/AAB filename.
173
166
 
174
- ### Windows recommended method
167
+ ### Android Version and versionCode
175
168
 
176
- Open **PowerShell** or **Windows Terminal** and install Eclipse Temurin 21:
169
+ New projects start with:
177
170
 
178
- ```powershell
179
- winget install EclipseAdoptium.Temurin.21.JDK
171
+ ```text
172
+ Version: 0.1
173
+ versionCode: 1
180
174
  ```
181
175
 
182
- When installation finishes, **close VS Code and all terminal windows, then reopen them**. This is important because an already-open terminal may still have the old `PATH`.
176
+ Both counters auto-increment **after a successful Jenkins build** by default. Failed or cancelled builds do not consume a version.
183
177
 
184
- Verify Java:
178
+ The version rule is simple: the final numeric part increases by one.
185
179
 
186
- ```powershell
187
- java -version
180
+ ```text
181
+ 0.1 → 0.2
182
+ 0.9 → 0.10
183
+ 1.2.3 → 1.2.4
188
184
  ```
189
185
 
190
- A successful result should begin with Java 21, for example:
186
+ `versionCode` increments by one:
191
187
 
192
188
  ```text
193
- openjdk version "21..."
189
+ 1 2 → 3 → 4
194
190
  ```
195
191
 
196
- Also verify where Windows found Java:
192
+ You can change either value or turn either auto-increment switch off from:
197
193
 
198
- ```powershell
199
- where.exe java
194
+ ```text
195
+ indraq configure
196
+ → Mobile App
197
+ → Version & versionCode
200
198
  ```
201
199
 
202
- You should see a Java installation path instead of an error.
203
-
204
- #### If `winget` is unavailable
200
+ When auto-increment is disabled, IndraQ does not block the build. It prints a soft warning reminding you that the same value will be reused.
205
201
 
206
- Download a **Java 21 JDK** installer from Eclipse Adoptium / Temurin and install it. During setup, enable the options that add Java to `PATH` and set `JAVA_HOME` when available.
202
+ ### Predictable Android artifact names
207
203
 
208
- Official installation documentation:
204
+ APK/AAB files produced by the IndraQ mobile Jenkinsfile now follow:
209
205
 
210
- - https://adoptium.net/installation/windows
211
- - https://learn.microsoft.com/windows/dev-environment/java
212
-
213
- #### If Java is installed but `java -version` still fails
206
+ ```text
207
+ <AppName>_<Version>_<versionCode>_<YYYY-MM-DD>_<HHmm>.<apk|aab>
208
+ ```
214
209
 
215
- First restart VS Code / your terminal. If it still fails, check:
210
+ Example:
216
211
 
217
- ```powershell
218
- $env:JAVA_HOME
219
- $env:Path
220
- where.exe java
212
+ ```text
213
+ Nefazo_0.1_1_2026-08-30_2051.apk
221
214
  ```
222
215
 
223
- If needed, set `JAVA_HOME` to your Java 21 installation folder and add `%JAVA_HOME%\bin` to the Windows system `Path`.
216
+ The date/time is always generated in **Asia/Kolkata (IST)**. Time contains hours and minutes only.
224
217
 
225
- Example installation location:
218
+ ### Mobile still always uses Production Jenkins
219
+
220
+ The Jenkins rule remains intentionally simple:
226
221
 
227
222
  ```text
228
- C:\Program Files\Eclipse Adoptium\jdk-21...
223
+ indraq build mobile:dev → Production Jenkins
224
+ indraq build mobile:staging → Production Jenkins
225
+ indraq build mobile:prod → Production Jenkins
229
226
  ```
230
227
 
231
- Then reopen the terminal and verify again:
228
+ Docker continues to support both Development and Production Jenkins:
232
229
 
233
- ```powershell
234
- java -version
235
- javac -version
230
+ ```text
231
+ indraq deploy:dev → Development Jenkins
232
+ indraq deploy:prod → Production Jenkins
236
233
  ```
237
234
 
238
- ### Ubuntu / Debian
235
+ ### Existing v1.4 mobile projects migrate automatically
239
236
 
240
- Install OpenJDK 21:
237
+ Existing `.indraq/mobile.json` files are upgraded automatically. Project type, app name, version/versionCode, auto-increment settings, and environment defaults are preserved when present. Older configurable mobile Jenkins job names are removed because mobile now always targets **`Mobile app Cli build`**.
241
238
 
242
- ```bash
243
- sudo apt update
244
- sudo apt install -y openjdk-21-jdk
245
- ```
239
+ ---
246
240
 
247
- Verify:
241
+ ## Requirements
248
242
 
249
- ```bash
250
- java -version
251
- javac -version
252
- ```
243
+ ### Developer computer
253
244
 
254
- If more than one Java version is installed, check/select the active version with:
245
+ | Requirement | Why | Check |
246
+ |---|---|---|
247
+ | **Node.js 22+** | Runs IndraQ CLI | `node --version` |
248
+ | **npm** | Installs / updates the CLI | `npm --version` |
249
+ | **Git** | Docker/GHCR authentication and optional source revision metadata | `git --version` |
250
+ | **Docker** | Docker deployment module | `docker --version` |
251
+ | **Java** | Runs Jenkins CLI | `java -version` |
252
+ | **tar** | Packages the local mobile source snapshot | `tar --version` |
253
+ | **Jenkins account** | Starts Jenkins jobs | Jenkins username + API token |
255
254
 
256
- ```bash
257
- sudo update-alternatives --config java
258
- ```
255
+ > [!TIP]
256
+ > Node.js **24** is recommended for IndraQ developer machines, but v1.5.1 supports Node.js **22 and newer**.
259
257
 
260
- ### macOS
258
+ ### Jenkins mobile build machine
261
259
 
262
- If Homebrew is installed:
260
+ The provided mobile Jenkinsfile expects the Jenkins agent to have:
263
261
 
264
- ```bash
265
- brew install --cask temurin@21
262
+ - Java;
263
+ - Node.js and npm;
264
+ - Android SDK;
265
+ - `sdkmanager`;
266
+ - Bash;
267
+ - `tar` / `sha256sum`;
268
+ - Jenkins **File Parameter** plugin;
269
+ - writable `/opt/mobile-builder`;
270
+ - Android SDK at `/opt/android-sdk` unless you edit the Jenkinsfile.
271
+
272
+ ---
273
+
274
+ ## Install Java 21
275
+
276
+ Java is required because Jenkins distributes its CLI as `jenkins-cli.jar`.
277
+
278
+ ### Windows
279
+
280
+ Open PowerShell:
281
+
282
+ ```powershell
283
+ winget install EclipseAdoptium.Temurin.21.JDK
266
284
  ```
267
285
 
268
- Then reopen the terminal and verify:
286
+ Then **fully close and reopen VS Code**.
269
287
 
270
- ```bash
288
+ Verify:
289
+
290
+ ```powershell
271
291
  java -version
292
+ where.exe java
272
293
  ```
273
294
 
274
- ### Final Java check
275
-
276
- Do not continue until this works:
295
+ ### Ubuntu / Debian
277
296
 
278
297
  ```bash
298
+ sudo apt update
299
+ sudo apt install -y openjdk-21-jdk
279
300
  java -version
280
301
  ```
281
302
 
282
- Then run:
303
+ ### macOS
304
+
305
+ Using Homebrew:
283
306
 
284
307
  ```bash
285
- indraq configure
308
+ brew install --cask temurin@21
309
+ java -version
286
310
  ```
287
311
 
288
- IndraQ CLI will perform the Java check again before downloading and starting `jenkins-cli.jar`.
312
+ > [!IMPORTANT]
313
+ > If `java -version` fails, fix Java before running Jenkins configuration.
289
314
 
290
315
  ---
291
316
 
292
- ## Install the CLI
317
+ ## Install IndraQ CLI
293
318
 
294
- IndraQ CLI is published as the public npm package **`indraq_cli`**. Install it globally once:
319
+ Install globally:
295
320
 
296
321
  ```bash
297
322
  npm install -g indraq_cli
298
323
  ```
299
324
 
300
- Then verify the command:
325
+ Verify:
301
326
 
302
327
  ```bash
303
328
  indraq --version
304
- indraq --help
305
329
  ```
306
330
 
307
- You should now be able to use `indraq` from any project folder:
331
+ Expected for this release:
308
332
 
309
- ```bash
310
- indraq configure
311
- indraq deploy:dev
312
- indraq deploy:prod
313
- ```
314
-
315
- ### Update to the newest version
316
-
317
- ```bash
318
- npm update -g indraq_cli
333
+ ```text
334
+ 1.5.1
319
335
  ```
320
336
 
321
- Then confirm the installed version:
337
+ Update later:
322
338
 
323
339
  ```bash
324
- indraq --version
340
+ npm install -g indraq_cli@latest
325
341
  ```
326
342
 
327
- ### Uninstall
343
+ Uninstall:
328
344
 
329
345
  ```bash
330
346
  npm uninstall -g indraq_cli
331
347
  ```
332
348
 
333
- ### If `indraq` is not found after installation
349
+ ---
350
+
351
+ ## Run the doctor
334
352
 
335
- First check where npm installs global commands:
353
+ Before debugging a mysterious machine problem, run:
336
354
 
337
355
  ```bash
338
- npm prefix -g
356
+ indraq doctor
339
357
  ```
340
358
 
341
- On Windows, also run:
342
-
343
- ```powershell
344
- where.exe indraq
345
- ```
359
+ It checks:
346
360
 
347
- On macOS/Linux:
361
+ - Node.js version;
362
+ - Java;
363
+ - Git;
364
+ - `tar`;
365
+ - how the `indraq` command resolves on your machine.
348
366
 
349
- ```bash
350
- which indraq
351
- ```
367
+ This is especially useful on Windows if another file named `IndraQ` is shadowing the npm executable.
352
368
 
353
- If another file or program is found before the npm launcher, run `indraq doctor` if the CLI is reachable by another terminal/session, or fix the conflicting PATH entry.
369
+ ---
354
370
 
355
- ### Developing the CLI itself
371
+ ## Configuration home
356
372
 
357
- Contributors working on the IndraQ CLI source can still use:
373
+ Run from the project you want to configure:
358
374
 
359
375
  ```bash
360
- npm ci
361
- npm run build
362
- npm link
376
+ indraq configure
363
377
  ```
364
378
 
365
- `npm link` is for CLI development only. Normal users should install the published package with `npm install -g indraq_cli`.
379
+ You will see:
366
380
 
367
- ---
381
+ ```text
382
+ IndraQ CLI Configuration
368
383
 
369
- ## First-time configuration
384
+ ? What do you want to configure?
385
+ > Jenkins
386
+ Docker / GHCR
387
+ Mobile App
388
+ ------------------------------
389
+ Review current project configuration
390
+ Exit
391
+ ```
370
392
 
371
- Go to the **application repository you want to deploy**, not the IndraQ CLI source repository.
393
+ The rule is simple:
372
394
 
373
- Example:
395
+ > **Persistent settings are changed with `indraq configure`. One-time build changes are supplied as flags.**
374
396
 
375
- ```bash
376
- cd C:\Projects\my-service
377
- indraq configure
378
- ```
397
+ ---
398
+
399
+ ## Configure Jenkins
379
400
 
380
- On the **first run only**, IndraQ CLI does a complete setup because the project does not have a finished deployment configuration yet.
401
+ Choose:
381
402
 
382
403
  ```text
383
- indraq configure
384
-
385
- ├── choose environment
386
- ├── configure image name
387
- ├── connect and verify Jenkins
388
- ├── choose GitHub / GHCR destination
389
- ├── choose Dockerfile
390
- └── save configuration
404
+ Configure
405
+ └── Jenkins
391
406
  ```
392
407
 
393
- After this first successful setup, `indraq configure` changes behavior. It does **not** make you enter everything again. See [Change configuration later](#change-configuration-later).
394
-
395
- ### Step 1 - Choose environment
408
+ The Jenkins menu is:
396
409
 
397
410
  ```text
398
- ? Select the environment you want to configure:
399
411
  > Development
400
- Production
412
+ Production — used by all mobile builds
413
+ ------------------
414
+ Review Jenkins connections
415
+ Back
401
416
  ```
402
417
 
403
- Development is stored as `dev`; production is stored as `prod`.
418
+ There are only **two Jenkins infrastructure environments** in a project.
404
419
 
405
- ### Step 2 - Enter image name
420
+ | Jenkins connection | Used by |
421
+ |---|---|
422
+ | **Development** | `indraq deploy:dev` |
423
+ | **Production** | `indraq deploy:prod` **and every mobile build** |
406
424
 
407
- Example:
425
+ This means:
408
426
 
409
427
  ```text
410
- ? Enter image name for DEV environment:
411
- immortality-accounting-service
428
+ Mobile Development ┐
429
+ Mobile Staging ├──→ Production Jenkins
430
+ Mobile Production ┘
412
431
  ```
413
432
 
414
- This name is important because the CLI also looks for a Jenkins job with **the same name**.
415
-
416
- ### Step 3 - Connect Jenkins
433
+ A command such as `indraq build mobile:dev` means **build the app using its Development mobile settings on Production Jenkins**. It does not mean “use Development Jenkins.”
417
434
 
418
- You enter:
435
+ For each Jenkins connection, IndraQ asks for:
419
436
 
420
437
  ```text
421
438
  Jenkins URL/domain
@@ -423,769 +440,1121 @@ Jenkins username
423
440
  Jenkins API token or password
424
441
  ```
425
442
 
426
- Example Jenkins URL:
443
+ It then:
427
444
 
428
- ```text
429
- https://jenkins.example.com
430
- ```
445
+ 1. downloads `<jenkins>/jnlpJars/jenkins-cli.jar`;
446
+ 2. stores the secret outside the project;
447
+ 3. runs Jenkins `who-am-i`;
448
+ 4. rejects wrong credentials immediately;
449
+ 5. saves the verified non-secret connection metadata in `.indraq/jenkins.json`.
431
450
 
432
- IndraQ CLI then performs these checks automatically:
451
+ Configure Jenkins once per project. Normal Docker/mobile build commands reuse the saved connection and credentials.
433
452
 
434
- ```text
435
- 1. Is Java available?
436
- 2. Can the CLI download /jnlpJars/jenkins-cli.jar?
437
- 3. Can these credentials authenticate?
438
- 4. Does Jenkins CLI `who-am-i` identify a real user?
439
- 5. Does WebSocket mode work? If not, can HTTP CLI mode work?
440
- ```
453
+ Use a Jenkins API token instead of an account password whenever possible.
441
454
 
442
- If the credentials are wrong, configuration **fails immediately**. Bad Jenkins credentials are not silently saved.
443
-
444
- > [!NOTE]
445
- > The Jenkins connection is currently **project-level**. Development and Production share the same Jenkins controller/account, while each environment can have its own image/job name.
455
+ ---
446
456
 
447
- ### Step 4 - Choose GitHub destination
457
+ ## Configure Docker / GHCR
448
458
 
449
- You choose:
459
+ Choose:
450
460
 
451
461
  ```text
452
- Personal GitHub account
453
- or
454
- GitHub organization
462
+ Configure
463
+ └── Docker / GHCR
455
464
  ```
456
465
 
457
- If you select an organization, the CLI shows the organizations available to your authenticated GitHub account.
458
-
459
- Example:
466
+ The menu lets you independently change:
460
467
 
461
468
  ```text
462
- ? Where do you want to push the GHCR image? Organization
463
- ? Select a GitHub organization: IndraQ-Innovations
469
+ Development
470
+ Production
471
+ GitHub / GHCR destination
472
+ Review
473
+ Back
464
474
  ```
465
475
 
466
- > [!NOTE]
467
- > The GitHub/GHCR destination is currently **project-level** and is shared by Development and Production.
476
+ Development and Production each store:
468
477
 
469
- ### Step 5 - Choose Dockerfile
478
+ - image name;
479
+ - Dockerfile path.
470
480
 
471
- Usually choose the normal file:
481
+ GitHub/GHCR stores:
482
+
483
+ - personal account or organization;
484
+ - selected GHCR owner.
485
+
486
+ The Docker deployment Jenkins connection is configured separately under **Jenkins**.
487
+
488
+ When `indraq deploy:dev` or `indraq deploy:prod` has built and pushed the image, the CLI starts the Jenkins job whose name matches the image repository name (for example `ghcr.io/indraq-innovations/immortality-accounting-service` maps to Jenkins job `immortality-accounting-service`) and supplies exactly:
472
489
 
473
490
  ```text
474
- Dockerfile
491
+ ACTION=DEPLOY
492
+ IMAGE_TAG=<primary pushed tag>
493
+ IMAGE_DIGEST=<sha256 digest, when available>
494
+ DEPLOYMENT_SOURCE=INDRAQ_CLI
475
495
  ```
476
496
 
477
- If your Dockerfile has another path, select the custom-path option.
478
-
479
- The Dockerfile path is stored separately for Development and Production.
497
+ This is the CLI path; the Jenkinsfile may still keep its Generic Webhook Trigger for other deployment sources if you want it.
480
498
 
481
499
  ---
482
500
 
483
- ## Change configuration later
501
+ ## Configure Mobile App
484
502
 
485
- This is the normal behavior after the project has already been configured once.
486
-
487
- Run:
503
+ Choose:
488
504
 
489
- ```bash
490
- indraq configure
505
+ ```text
506
+ Configure
507
+ └── Mobile App
491
508
  ```
492
509
 
493
- First choose the environment you want to work on:
510
+ The menu is:
494
511
 
495
512
  ```text
496
- ? Select the environment you want to configure:
497
- > Development
513
+ > Project settings
514
+ Version & versionCode
515
+ Development
516
+ Staging
498
517
  Production
518
+ ------------------
519
+ Review Mobile App configuration
520
+ Back
499
521
  ```
500
522
 
501
- Then IndraQ CLI shows a **settings menu** instead of replaying the whole setup wizard:
523
+ ### Project settings
524
+
525
+ IndraQ asks for:
502
526
 
503
527
  ```text
504
- ? What do you want to configure for Development?
505
- > Image name (immortality-accounting-service)
506
- Jenkins connection (https://jenkins.example.com (harry)) [shared]
507
- GitHub / GHCR destination (organization: indraq-innovations) [shared]
508
- Dockerfile path (Dockerfile)
509
- ─────────────────────────────────────────────────────────────
510
- Review current configuration
511
- Exit configuration
528
+ Mobile app name
529
+ Project type
530
+ - Expo
531
+ - React Native CLI
512
532
  ```
513
533
 
514
- Choose **only the setting you actually want to change**.
534
+ The app name is saved per project and is used in the final APK/AAB filename.
515
535
 
516
- For example, if you only want to change the Dockerfile:
536
+ The mobile Jenkins job is **not configurable**. Every mobile build targets exactly:
517
537
 
518
538
  ```text
519
- Dockerfile path
520
-
521
- change Dockerfile
522
-
523
- save only that change
524
-
525
- return to the settings menu
539
+ Mobile app Cli build
526
540
  ```
527
541
 
528
- The other settings are left untouched.
542
+ All mobile Development, Staging, and Production builds use the project's **Production Jenkins** connection. The CLI verifies that `Mobile app Cli build` exists before uploading source.
529
543
 
530
- ### The menu stays open until you exit
544
+ ### Version & versionCode settings
531
545
 
532
- After every successful change, IndraQ CLI saves it and returns you to the same menu:
546
+ Choose:
533
547
 
534
548
  ```text
535
- Change image name
536
-
537
- Saved
538
-
539
- Settings menu
540
-
541
- Change GitHub destination
542
-
543
- Saved
544
-
545
- Settings menu
546
-
547
- Exit configuration
549
+ Mobile App
550
+ → Version & versionCode
548
551
  ```
549
552
 
550
- This lets you update several settings in one session without running `indraq configure` again and again.
551
-
552
- If you are finished, choose:
553
+ You can configure these independently:
553
554
 
554
555
  ```text
555
- Exit configuration
556
+ Version
557
+ versionCode
558
+ Auto-increment Version
559
+ Auto-increment versionCode
556
560
  ```
557
561
 
558
- ### Review without changing anything
559
-
560
- Choose:
562
+ Defaults:
561
563
 
562
564
  ```text
563
- Review current configuration
565
+ Version: 0.1
566
+ versionCode: 1
567
+ Auto-increment Version: ON
568
+ Auto-increment versionCode: ON
564
569
  ```
565
570
 
566
- The CLI shows the selected environment's non-secret settings, including:
571
+ Auto-increment happens only after Jenkins reports `SUCCESS`. A failed build leaves both saved values unchanged.
572
+
573
+ If you manually change Version/versionCode while a Jenkins build is still running, IndraQ will not overwrite your newer values when that build finishes.
574
+
575
+ ### Version values survive Git clones
576
+
577
+ `.indraq/mobile.json` is project configuration and should be committed. That means another developer who clones/pulls the repository receives the same next Version/versionCode.
578
+
579
+ IndraQ also synchronizes the configured values into the Android-facing project file when it can do so safely:
567
580
 
568
581
  ```text
569
- Environment
570
- Image name
571
- Dockerfile path
572
- GHCR destination
573
- Jenkins URL
574
- Jenkins username
575
- Expected Jenkins job name
582
+ Expo → app.json → expo.version + expo.android.versionCode
583
+ React Native CLI → android/app/build.gradle(.kts) → versionName + versionCode
576
584
  ```
577
585
 
578
- The Jenkins API token/password is **never printed**.
586
+ Before a remote build, Jenkins applies the requested values again after Expo prebuild / before Gradle, so the artifact uses the values shown in the CLI build plan.
587
+
588
+ After a successful build with auto-increment enabled, commit the changed `.indraq/mobile.json` and synced app-version file(s). Failed builds do not increment the shared values.
579
589
 
580
- ### What is environment-specific and what is shared?
590
+ ### Environment settings
581
591
 
582
- | Setting | Development / Production separate? |
592
+ Each mobile environment stores:
593
+
594
+ - default build output;
595
+ - default build profile.
596
+
597
+ Profiles:
598
+
599
+ | Profile | Meaning |
583
600
  |---|---|
584
- | Image name | **Yes** |
585
- | Dockerfile path | **Yes** |
586
- | Jenkins connection | No shared by the project |
587
- | GitHub / GHCR destination | No — shared by the project |
588
- | Jenkins API token/password | No — tied to the saved Jenkins account and kept outside the project config |
601
+ | **FAST** | Fresh source snapshot, reuse project-scoped npm/Gradle caches |
602
+ | **CLEAN** | Clean generated project build state before building |
603
+ | **FULL_RESET** | Clear this project's Jenkins build caches before rebuilding |
589
604
 
590
- If you change a setting marked **`[shared]`**, that change affects deployments for both Development and Production.
605
+ After saving one environment you return to the Mobile App menu, so you can configure another environment without rerunning the command.
591
606
 
592
607
  ---
593
608
 
594
- ## Deploy development
609
+ ## Docker deployment
595
610
 
596
- Use either command:
611
+ Development:
597
612
 
598
613
  ```bash
599
614
  indraq deploy:dev
600
615
  ```
601
616
 
602
- or the long alias:
617
+ Alias:
603
618
 
604
619
  ```bash
605
620
  indraq deploy:development
606
621
  ```
607
622
 
608
- The CLI checks the **development** configuration, builds the configured image, pushes it to GHCR, and starts the Jenkins job with the same image name.
623
+ Production:
624
+
625
+ ```bash
626
+ indraq deploy:prod
627
+ ```
628
+
629
+ Alias:
630
+
631
+ ```bash
632
+ indraq deploy:production
633
+ ```
634
+
635
+ Docker deployment still follows this flow:
636
+
637
+ ```text
638
+ validate Docker / GitHub / Java / Jenkins
639
+
640
+ build Docker image
641
+
642
+ push image to GHCR
643
+
644
+ find Jenkins job with same name as image
645
+
646
+ run Jenkins pipeline
647
+
648
+ stream logs into terminal
649
+ ```
650
+
651
+ ---
652
+
653
+ ## Mobile build overview
654
+
655
+ > [!IMPORTANT]
656
+ > **Every mobile build runs on the saved Production Jenkins connection.** `mobile:dev`, `mobile:staging`, and `mobile:prod` are mobile application environments, not Jenkins environments.
657
+
609
658
 
610
- You will be asked for one or more Docker tags:
659
+ The mobile module deliberately does **not** ask for:
660
+
661
+ - Git repository URL;
662
+ - Git branch;
663
+ - app subdirectory;
664
+ - pasted env text;
665
+ - "save env" checkbox.
666
+
667
+ Why? Because the CLI is already running inside the developer's project.
668
+
669
+ ### Root directory rule
670
+
671
+ Run mobile builds from the directory containing the mobile app's `package.json`.
672
+
673
+ Correct:
611
674
 
612
675
  ```text
613
- ? Enter image tags: latest
676
+ my-mobile-app/
677
+ ├── package.json ← run command here
678
+ ├── .env
679
+ ├── src/
680
+ ├── android/ ← React Native CLI
681
+ └── ...
614
682
  ```
615
683
 
616
- Multiple tags are supported:
684
+ Wrong:
617
685
 
618
686
  ```text
619
- latest,dev-2026-08-30
687
+ my-mobile-app/android/ ← do not run it here
620
688
  ```
621
689
 
690
+ IndraQ does not silently search parent folders. If `package.json` is not in the current directory, the build stops.
691
+
622
692
  ---
623
693
 
624
- ## Deploy production
694
+ ## Mobile build matrix
625
695
 
626
- Use either:
696
+ Invalid combinations are blocked both by the CLI **and** by the Jenkinsfile.
697
+
698
+ | Project type | Environment | Allowed output |
699
+ |---|---|---|
700
+ | Expo | Development | **Development Client only** |
701
+ | Expo | Staging | **Release APK** or **Release AAB** |
702
+ | Expo | Production | **Release APK** or **Release AAB** |
703
+ | React Native CLI | Development | **Debug APK only** |
704
+ | React Native CLI | Staging | **Release APK** or **Release AAB** |
705
+ | React Native CLI | Production | **Release APK** or **Release AAB** |
706
+
707
+ The CLI does not show impossible choices during configuration.
708
+
709
+ For example, Expo Development automatically becomes:
710
+
711
+ ```text
712
+ Build output: Development Client
713
+ ```
714
+
715
+ There is no pointless APK/AAB menu for that combination.
716
+
717
+ ---
718
+
719
+ ## Mobile build commands
720
+
721
+ Development:
627
722
 
628
723
  ```bash
629
- indraq deploy:prod
724
+ indraq build mobile:dev
630
725
  ```
631
726
 
632
- or:
727
+ Alias:
633
728
 
634
729
  ```bash
635
- indraq deploy:production
730
+ indraq build mobile:development
636
731
  ```
637
732
 
638
- A production deployment follows the same protected flow but uses the production environment configuration.
733
+ Staging:
639
734
 
640
- Example:
735
+ ```bash
736
+ indraq build mobile:staging
737
+ ```
641
738
 
642
- ```text
643
- Environment: PROD
644
- Image: ghcr.io/indraq-innovations/my-service
645
- Tag: 1.8.0
646
- Jenkins job: my-service
739
+ Production:
740
+
741
+ ```bash
742
+ indraq build mobile:prod
647
743
  ```
648
744
 
745
+ Alias:
746
+
747
+ ```bash
748
+ indraq build mobile:production
749
+ ```
750
+
751
+ ### First build
752
+
753
+ If required mobile configuration is missing, the CLI asks only for the missing settings and saves them.
754
+
755
+ ### Later builds
756
+
757
+ Once configured:
758
+
759
+ ```bash
760
+ indraq build mobile:staging
761
+ ```
762
+
763
+ uses the saved Staging output/profile without asking the same questions again.
764
+
765
+ Before uploading anything, IndraQ prints a build plan and asks for confirmation.
766
+
649
767
  ---
650
768
 
651
- ## Jenkins setup and rules
769
+ ## Mobile build flags
770
+
771
+ Flags override saved defaults **for one build only**.
652
772
 
653
- ### How Jenkins CLI is obtained
773
+ They do not permanently change `mobile.json`.
654
774
 
655
- You do **not** manually download a generic Jenkins CLI file.
775
+ ### Output override
776
+
777
+ ```bash
778
+ indraq build mobile:staging --output aab
779
+ ```
656
780
 
657
- During `indraq configure`, the CLI downloads the JAR directly from the Jenkins controller you entered:
781
+ Accepted output aliases:
658
782
 
659
783
  ```text
660
- https://YOUR-JENKINS/jnlpJars/jenkins-cli.jar
784
+ dev-client / development-client
785
+ debug / debug-apk
786
+ apk / release-apk
787
+ aab / release-aab
661
788
  ```
662
789
 
663
- This keeps the client aligned with that Jenkins controller.
790
+ The matrix is still enforced. For example, this is rejected:
664
791
 
665
- ### How credentials are checked
792
+ ```bash
793
+ indraq build mobile:dev --output aab
794
+ ```
666
795
 
667
- IndraQ CLI uses Jenkins CLI's `who-am-i` command. If Jenkins authenticates the user, setup continues. If authentication fails or Jenkins sees the request as anonymous, configuration stops.
796
+ for an Expo Development project.
668
797
 
669
- ### How a deployment is triggered
798
+ ### Profile override
799
+
800
+ ```bash
801
+ indraq build mobile:prod --profile clean
802
+ ```
670
803
 
671
- After the Docker image is successfully pushed, IndraQ CLI runs the equivalent of:
804
+ Available profiles:
672
805
 
673
806
  ```text
674
- jenkins-cli.jar build <IMAGE_NAME> -s -v
807
+ fast
808
+ clean
809
+ full-reset
675
810
  ```
676
811
 
677
- `-s` waits for Jenkins to finish and returns Jenkins' success/failure result. `-v` prints the build console output.
812
+ ### Verbose Gradle logs
678
813
 
679
- That means the VS Code terminal becomes your Jenkins log window:
814
+ ```bash
815
+ indraq build mobile:prod --verbose
816
+ ```
680
817
 
681
- ```text
682
- Started my-service #142
683
- [Pipeline] Start of Pipeline
684
- [Pipeline] stage
685
- [Pipeline] { (Deploy)
686
- ...
687
- Finished: SUCCESS
688
- Completed my-service #142 : SUCCESS
818
+ ### Dry run
819
+
820
+ Validate everything and print the plan without uploading source or starting Jenkins:
821
+
822
+ ```bash
823
+ indraq build mobile:staging --dry-run
824
+ ```
825
+
826
+ ### Skip final confirmation
827
+
828
+ Useful for a developer who already knows exactly what will run:
829
+
830
+ ```bash
831
+ indraq build mobile:prod --yes
689
832
  ```
690
833
 
691
- If Jenkins fails, the CLI also fails and leaves the Jenkins error output visible above it.
834
+ Example combination:
835
+
836
+ ```bash
837
+ indraq build mobile:prod --output aab --profile clean --verbose --yes
838
+ ```
692
839
 
693
- ### Required Jenkins permissions
840
+ ---
694
841
 
695
- The Jenkins user must be allowed to:
842
+ ## Android versioning and artifact names
696
843
 
697
- - authenticate to Jenkins CLI;
698
- - read the target job;
699
- - trigger/build the target job;
700
- - view the build output needed by the CLI.
844
+ IndraQ v1.5.1 currently manages **Android** versioning only. iOS version/build-number management is intentionally out of scope for now.
701
845
 
702
- If Jenkins returns `403`, ask the Jenkins administrator to check permissions for that account.
846
+ ### What value does a build use?
703
847
 
704
- ### Job naming rule
848
+ A build uses the values currently stored in `.indraq/mobile.json`.
705
849
 
706
- For now, IndraQ CLI deliberately uses a zero-mapping rule:
850
+ Example before the build:
707
851
 
708
852
  ```text
709
- Docker image name == Jenkins job name
853
+ Version: 0.1
854
+ versionCode: 1
710
855
  ```
711
856
 
712
- This avoids hidden routing tables and webhook payload rules.
857
+ The Jenkins build receives exactly `0.1` and `1`, applies them to the generated/native Android Gradle project, and produces the APK/AAB with those values.
713
858
 
714
- ---
859
+ Only after Jenkins finishes successfully are enabled counters advanced for the next build.
715
860
 
716
- ## GitHub and GHCR
861
+ ### Auto-increment examples
717
862
 
718
- IndraQ CLI accepts normal Git/Git Bash authentication and does **not** require GitHub CLI (`gh`).
863
+ With both switches ON:
719
864
 
720
- It can use:
865
+ ```text
866
+ Build 1 uses: 0.1 / 1
867
+ Success
868
+ Next saved: 0.2 / 2
721
869
 
722
- - Git Credential Manager / HTTPS credentials;
723
- - GitHub CLI credentials when available;
724
- - GitHub SSH authentication for Git operations.
870
+ Build 2 uses: 0.2 / 2
871
+ Success
872
+ Next saved: 0.3 / 3
873
+ ```
725
874
 
726
- GHCR does not accept SSH keys as registry credentials. If your GitHub session is SSH-only, Docker may still require a one-time registry login:
875
+ If `Auto-increment Version` is OFF:
727
876
 
728
- ```bash
729
- docker login ghcr.io
877
+ ```text
878
+ Version stays 0.1
879
+ versionCode may still move 1 → 2 → 3
730
880
  ```
731
881
 
732
- Your final image looks like:
882
+ If `Auto-increment versionCode` is OFF, IndraQ prints a warning before every mobile build because Android release stores normally expect a higher versionCode for upgrades.
883
+
884
+ ### Artifact filename
885
+
886
+ The Jenkins mobile pipeline renames the primary APK/AAB to:
733
887
 
734
888
  ```text
735
- ghcr.io/<owner>/<image>:<tag>
889
+ <AppName>_<Version>_<versionCode>_<YYYY-MM-DD>_<HHmm>.<extension>
736
890
  ```
737
891
 
738
892
  Example:
739
893
 
740
894
  ```text
741
- ghcr.io/indraq-innovations/immortality-accounting-service:latest
895
+ Nefazo_User_1.4_27_2026-08-30_2051.aab
742
896
  ```
743
897
 
898
+ Rules:
899
+
900
+ - timezone: `Asia/Kolkata` (IST);
901
+ - date: `YYYY-MM-DD`;
902
+ - time: 24-hour `HHmm`;
903
+ - seconds are intentionally omitted;
904
+ - unsafe filename characters in the configured app name are replaced with `_`.
905
+
744
906
  ---
745
907
 
746
- ## Where configuration and secrets live
908
+ ## How local source reaches Jenkins
747
909
 
748
- ### Project configuration
910
+ This is the mobile source-upload design.
749
911
 
750
- Each application gets:
912
+ The old mobile Jenkins pipeline cloned a Git URL. The new flow builds the files that are **actually on the developer's computer right now**.
751
913
 
752
- ```text
753
- <your-project>/.indraq/deploy.json
914
+ ```mermaid
915
+ flowchart TD
916
+ A[Developer runs indraq build mobile:prod] --> B[Verify current directory is project root]
917
+ B --> C[Validate Expo / React Native project]
918
+ C --> D[Create clean temporary source snapshot]
919
+ D --> E[Calculate SHA-256]
920
+ E --> F[Upload snapshot to Jenkins]
921
+ F --> G[Jenkins verifies SHA-256]
922
+ G --> H[Extract source]
923
+ H --> I[Build Android]
924
+ I --> J[Archive APK / AAB]
925
+ J --> K[Stream logs + artifact URL to terminal]
754
926
  ```
755
927
 
756
- Example:
928
+ ### What is excluded from the source snapshot?
929
+
930
+ IndraQ excludes common generated/sensitive files such as:
757
931
 
758
- ```json
759
- {
760
- "schemaVersion": 2,
761
- "github": {
762
- "ownerType": "organization",
763
- "owner": "IndraQ-Innovations"
764
- },
765
- "jenkins": {
766
- "url": "https://jenkins.example.com",
767
- "username": "developer",
768
- "serverId": "8be77a9980d4c19a",
769
- "connectionMode": "webSocket"
770
- },
771
- "environments": {
772
- "dev": {
773
- "name": "Development",
774
- "imageName": "my-service-dev",
775
- "dockerfilePath": "Dockerfile"
776
- },
777
- "prod": {
778
- "name": "Production",
779
- "imageName": "my-service",
780
- "dockerfilePath": "Dockerfile"
781
- }
782
- }
783
- }
932
+ ```text
933
+ .git/
934
+ .indraq/
935
+ node_modules/
936
+ coverage/
937
+ dist/
938
+ build/
939
+ .vscode/
940
+ .idea/
941
+ .env
942
+ .env.*
943
+ *.apk
944
+ *.aab
945
+ android/.gradle/
946
+ android/app/build/
947
+ ios/Pods/
784
948
  ```
785
949
 
786
- Notice what is **not** there: your Jenkins API token/password.
950
+ The source archive is created in the system temporary directory, uploaded, then deleted locally.
951
+
952
+ ### Why SHA-256?
787
953
 
788
- ### Jenkins CLI cache and secret
954
+ The CLI calculates a SHA-256 hash before upload. Jenkins calculates it again before extraction.
789
955
 
790
- Jenkins runtime files are kept under the user's home directory:
956
+ If they do not match, the build stops.
957
+
958
+ ---
959
+
960
+ ## Root .env behavior
961
+
962
+ You no longer paste `.env` into Jenkins.
963
+
964
+ For build outputs that need an environment file, IndraQ automatically uses:
791
965
 
792
966
  ```text
793
- ~/.indraq/jenkins/<server-id>/
794
- ├── jenkins-cli.jar
795
- └── auth
967
+ <mobile-project-root>/.env
796
968
  ```
797
969
 
798
- The `auth` file is passed to Jenkins CLI using its credential-file mechanism instead of putting the secret directly into the Java command line.
970
+ The `.env` file is:
971
+
972
+ 1. **not included** inside the source archive;
973
+ 2. uploaded separately as a Jenkins file parameter;
974
+ 3. copied into the temporary build source;
975
+ 4. never printed in logs;
976
+ 5. removed from the Jenkins workspace in `post { always { ... } }`.
799
977
 
800
978
  > [!CAUTION]
801
- > This is still a local secret. Never copy the `auth` file into a repository, chat message, ticket, or documentation. On shared computers, use a dedicated OS account and prefer Jenkins API tokens with limited permissions.
979
+ > Jenkins file parameters can remain in Jenkins build data according to your controller/plugin retention behavior. The workspace copy is deleted, but highly sensitive production secrets should still follow your normal Jenkins retention and secret-management policy.
802
980
 
803
- The project-local `.indraq` folder also gets a `.gitignore` so its local state is not accidentally committed.
981
+ If a required `.env` is missing, the build stops before source upload.
982
+
983
+ Expo Development Client does not require `.env`, but if a root `.env` exists IndraQ still supplies it automatically.
804
984
 
805
985
  ---
806
986
 
807
- ## Command reference
987
+ ## Mobile Jenkins setup
808
988
 
809
- ### Normal commands
989
+ The mobile source-upload workflow requires the Jenkins **File Parameter** plugin.
810
990
 
811
- | Command | What it does |
812
- |---|---|
813
- | `indraq --version` | Show installed CLI version |
814
- | `indraq --help` | Show available commands |
815
- | `indraq configure` | First run: complete setup. Later runs: open the environment settings menu |
816
- | `indraq deploy:dev` | Deploy development |
817
- | `indraq deploy:development` | Same as `deploy:dev` |
818
- | `indraq deploy:prod` | Deploy production |
819
- | `indraq deploy:production` | Same as `deploy:prod` |
820
-
821
- ### Structured commands
991
+ ### Step 1 install the plugin
822
992
 
823
- These are kept for automation and discoverability:
993
+ In Jenkins:
824
994
 
825
- ```bash
826
- indraq deploy configure
827
- indraq deploy build --env dev
828
- indraq deploy build --env development
829
- indraq deploy build --env prod
830
- indraq deploy build --env production
995
+ ```text
996
+ Manage Jenkins
997
+ Plugins
998
+ Available plugins
999
+ search: File Parameter
1000
+ install "File Parameter"
831
1001
  ```
832
1002
 
833
- ---
1003
+ Plugin ID:
834
1004
 
835
- ## Project architecture
1005
+ ```text
1006
+ file-parameters
1007
+ ```
1008
+
1009
+ ### Step 2 — use the IndraQ v1.5 mobile Jenkinsfile
836
1010
 
837
- IndraQ CLI is module-based from day one:
1011
+ This repository includes:
838
1012
 
839
1013
  ```text
840
- src/
841
- ├── index.ts
842
- ├── cli/
843
- │ └── create-program.ts
844
- ├── modules/
845
- │ └── deploy/
846
- │ ├── commands/
847
- │ │ ├── configure.command.ts
848
- │ │ └── build.command.ts
849
- │ ├── config/
850
- │ │ └── deployment-config.ts
851
- │ └── services/
852
- │ ├── docker.service.ts
853
- │ └── jenkins.service.ts
854
- └── shared/
855
- ├── git/
856
- └── github/
1014
+ templates/jenkins/Jenkinsfile-Mobile-App
857
1015
  ```
858
1016
 
859
- The rule is simple:
860
-
861
- > A future feature should become a module, not another giant block inside deployment.
1017
+ Use that pipeline for the Jenkins mobile build job.
862
1018
 
863
- For example:
1019
+ It declares two large file parameters:
864
1020
 
865
1021
  ```text
866
- src/modules/database/
867
- src/modules/backup/
868
- src/modules/server/
869
- src/modules/secrets/
870
- src/modules/diagnostics/
1022
+ SOURCE_BUNDLE
1023
+ ENV_FILE
871
1024
  ```
872
1025
 
873
- ---
1026
+ plus normal metadata/build parameters supplied automatically by the CLI.
874
1027
 
875
- ## Common errors
1028
+ > [!IMPORTANT]
1029
+ > If you replace an existing Pipeline Jenkinsfile with this one, run/save the job once if Jenkins needs an initial run to register the new parameter definitions. After that the CLI uses `buildWithParameters` automatically.
876
1030
 
877
- ### `Java is required for Jenkins CLI but was not found`
1031
+ ### Step 3 Jenkins agent paths
878
1032
 
879
- IndraQ CLI cannot run `jenkins-cli.jar` without Java.
1033
+ Default paths in the template:
880
1034
 
881
- Check:
1035
+ ```text
1036
+ ANDROID_HOME=/opt/android-sdk
1037
+ ANDROID_SDK_ROOT=/opt/android-sdk
1038
+ MOBILE_BUILDER_HOME=/opt/mobile-builder
1039
+ ```
1040
+
1041
+ Change the Jenkinsfile if your Jenkins agent uses different paths.
1042
+
1043
+ ### Step 4 — configure the CLI
882
1044
 
883
1045
  ```bash
884
- java -version
1046
+ indraq configure
885
1047
  ```
886
1048
 
887
- If that command fails, install **Java 21 LTS** using the [Install Java 21](#install-java-21) section above. On Windows, the quickest supported path is:
1049
+ Configure the Jenkins connection once:
888
1050
 
889
- ```powershell
890
- winget install EclipseAdoptium.Temurin.21.JDK
1051
+ ```text
1052
+ Jenkins
1053
+ → Production
891
1054
  ```
892
1055
 
893
- After installation, completely close and reopen VS Code / the terminal and run:
1056
+ Enter the Production Jenkins URL, username, and API token. **All mobile Development, Staging, and Production builds use this Production Jenkins connection.**
894
1057
 
895
- ```powershell
896
- java -version
897
- where.exe java
1058
+ Then configure the mobile project:
1059
+
1060
+ ```text
1061
+ Mobile App
1062
+ → Project settings
898
1063
  ```
899
1064
 
900
- Only retry `indraq configure` after Java is visible in the new terminal.
1065
+ Set the app name and project type. On Jenkins, create/rename the mobile Pipeline job to exactly:
901
1066
 
902
- ### `Jenkins authentication failed`
1067
+ ```text
1068
+ Mobile app Cli build
1069
+ ```
1070
+
1071
+ The CLI checks this exact job on Production Jenkins before every mobile build.
1072
+
1073
+ ### Live logs
1074
+
1075
+ Mobile source upload is triggered through Jenkins HTTP `buildWithParameters`, then IndraQ follows the queue item, discovers the build number, and streams progressive Jenkins console output into VS Code.
1076
+
1077
+ If Jenkins fails, the CLI exits with failure and leaves the Jenkins error visible in the terminal.
1078
+
1079
+ ---
903
1080
 
904
- Check all three values:
1081
+ ## Configuration and secret storage
1082
+
1083
+ Project-local configuration:
905
1084
 
906
1085
  ```text
907
- Jenkins URL
908
- Jenkins username
909
- Jenkins API token/password
1086
+ <project>/.indraq/
1087
+ ├── jenkins.json # shared — commit
1088
+ ├── docker.json # shared — commit
1089
+ ├── mobile.json # shared — commit
1090
+ ├── jenkins.local.json # machine-local — ignored
1091
+ └── .gitignore
910
1092
  ```
911
1093
 
912
- Prefer creating a fresh Jenkins API token and running:
1094
+ The generated `.indraq/.gitignore` ignores **only machine-local files** such as `jenkins.local.json`. Shared project configuration is intentionally visible to Git.
913
1095
 
914
- ```bash
915
- indraq configure
916
- ```
1096
+ > [!IMPORTANT]
1097
+ > Older IndraQ setups often ignored the whole `.indraq/` directory. v1.5.1 automatically appends safe re-include rules to the project root `.gitignore` so `jenkins.json`, `docker.json`, and `mobile.json` can be committed while `jenkins.local.json` remains ignored. Run `git status` after configuration and commit the three shared JSON files.
917
1098
 
918
- Choose the environment, select **Jenkins connection**, and enter the new credentials.
1099
+ ### `jenkins.json`
919
1100
 
920
- ### `No Jenkins pipeline/job named "my-service" was found`
1101
+ Stores non-secret Jenkins metadata:
921
1102
 
922
- Your configured image name and Jenkins job name do not match.
1103
+ ```text
1104
+ Development Jenkins connection
1105
+ Production Jenkins connection
1106
+ ```
923
1107
 
924
- If configuration says:
1108
+ Usage is fixed and easy to remember:
925
1109
 
926
1110
  ```text
927
- imageName = my-service
1111
+ Docker DEV → Development Jenkins
1112
+ Docker PROD → Production Jenkins
1113
+ Mobile DEV / STAGING / PROD → Production Jenkins
928
1114
  ```
929
1115
 
930
- Jenkins must contain:
1116
+ It stores Jenkins URL/transport only. It does **not** store Jenkins username, token, or password.
1117
+
1118
+ The local `jenkins.local.json` contains only the machine's credential binding ID and is ignored by Git. The actual username + API token/password remain under the user's home directory.
1119
+
1120
+ ### `docker.json`
1121
+
1122
+ Stores:
931
1123
 
932
1124
  ```text
933
- my-service
1125
+ GitHub / GHCR owner
1126
+ Development image + Dockerfile
1127
+ Production image + Dockerfile
934
1128
  ```
935
1129
 
936
- Either rename/create the Jenkins job or run `indraq configure`, choose the environment, and change **Image name** to the correct Jenkins job name.
1130
+ ### `mobile.json`
937
1131
 
938
- ### `Jenkins denied access`
1132
+ Stores:
939
1133
 
940
- The user authenticated successfully but does not have enough permission for that job. Ask the Jenkins administrator to check the account's read/build permissions.
1134
+ ```text
1135
+ stable project ID
1136
+ app name
1137
+ project type
1138
+ Android Version + versionCode
1139
+ auto-increment switches for Version + versionCode
1140
+ Development output/profile
1141
+ Staging output/profile
1142
+ Production output/profile
1143
+ ```
941
1144
 
942
- ### `Docker is not installed or is not accessible`
1145
+ It does **not** store `.env` values.
943
1146
 
944
- Check:
1147
+ ### Jenkins secret location
945
1148
 
946
- ```bash
947
- docker --version
948
- docker info
1149
+ Jenkins login credentials live outside the repository and never survive a Git clone:
1150
+
1151
+ ```text
1152
+ ~/.indraq/
1153
+ └── jenkins/
1154
+ └── <server-account-id>/
1155
+ ├── jenkins-cli.jar
1156
+ └── auth
949
1157
  ```
950
1158
 
951
- Make sure Docker Desktop / Docker Engine is running.
1159
+ Never commit this directory.
952
1160
 
953
- ### GHCR push is denied
1161
+ ---
954
1162
 
955
- Your GitHub credential may not have package write access for the selected owner/organization.
1163
+ ## Upgrade from v1.4 / v1.5
956
1164
 
957
- If you use SSH-only Git authentication, also try:
1165
+ Update the public package:
958
1166
 
959
1167
  ```bash
960
- docker login ghcr.io
1168
+ npm install -g indraq_cli@latest
961
1169
  ```
962
1170
 
963
- ### `indraq` opens the wrong Windows program
1171
+ Verify:
964
1172
 
965
- Run:
1173
+ ```bash
1174
+ indraq --version
1175
+ ```
966
1176
 
967
- ```powershell
968
- where.exe indraq
1177
+ Expected for this release:
1178
+
1179
+ ```text
1180
+ 1.5.1
969
1181
  ```
970
1182
 
971
- If another program appears before npm's launcher, Windows has a command-name collision. Remove/rename the unrelated launcher or correct PATH ordering.
1183
+ v1.5.1 automatically migrates older `.indraq/mobile.json` and Jenkins config layouts. Existing mobile environment/version settings are preserved. Older Jenkins username/server binding fields are split so only non-secret server metadata remains in tracked `jenkins.json`; the current machine binding is written to ignored `jenkins.local.json`.
972
1184
 
973
- ---
1185
+ For projects coming from pre-versioning releases, Android version settings initialize as:
974
1186
 
975
- ## Frequently asked questions
1187
+ ```text
1188
+ Version: 0.1
1189
+ versionCode: 1
1190
+ Auto Version: ON
1191
+ Auto versionCode: ON
1192
+ ```
976
1193
 
977
- ### Do I need the Generic Webhook Trigger plugin now?
1194
+ Because v1.5 did not store the configured app name, open:
978
1195
 
979
- No. The deployment flow no longer depends on a generic webhook URL. IndraQ CLI talks directly to Jenkins using Jenkins CLI.
1196
+ ```text
1197
+ indraq configure
1198
+ → Mobile App
1199
+ → Project settings
1200
+ ```
980
1201
 
981
- ### Do I need to download `jenkins-cli.jar` myself?
1202
+ and confirm the app name once.
982
1203
 
983
- No. The first-time setup or the **Jenkins connection** option inside `indraq configure` downloads the JAR from the Jenkins server you entered.
1204
+ Docker/GHCR and Jenkins configuration remain compatible.
984
1205
 
985
- ### Do I have to install GitHub CLI (`gh`)?
1206
+ ---
986
1207
 
987
- No. Normal Git/Git Bash authentication is supported. `gh` is optional.
1208
+ ## Command reference
988
1209
 
989
- ### Can I use a Jenkins password?
1210
+ | Command | Purpose |
1211
+ |---|---|
1212
+ | `indraq --version` | Show installed CLI version |
1213
+ | `indraq --help` | Show commands |
1214
+ | `indraq doctor` | Diagnose runtime / PATH prerequisites |
1215
+ | `indraq configure` | Open configuration home |
1216
+ | `indraq deploy:dev` | Docker Development deployment |
1217
+ | `indraq deploy:development` | Alias of `deploy:dev` |
1218
+ | `indraq deploy:prod` | Docker Production deployment |
1219
+ | `indraq deploy:production` | Alias of `deploy:prod` |
1220
+ | `indraq build mobile:dev` | Mobile Development build |
1221
+ | `indraq build mobile:development` | Alias of `mobile:dev` |
1222
+ | `indraq build mobile:staging` | Mobile Staging build |
1223
+ | `indraq build mobile:prod` | Mobile Production build |
1224
+ | `indraq build mobile:production` | Alias of `mobile:prod` |
1225
+
1226
+ Mobile flags:
990
1227
 
991
- The CLI accepts an API token or password, subject to your Jenkins security configuration. An API token is the safer choice and is recommended.
1228
+ ```text
1229
+ --output <dev-client|debug-apk|apk|aab>
1230
+ --profile <fast|clean|full-reset>
1231
+ --verbose
1232
+ --dry-run
1233
+ -y, --yes
1234
+ ```
992
1235
 
993
- ### Where can I see Jenkins build logs?
1236
+ ---
994
1237
 
995
- Directly in the same terminal where you ran:
1238
+ ## Troubleshooting
1239
+
1240
+ ### `Java is required for Jenkins CLI`
1241
+
1242
+ Check:
996
1243
 
997
1244
  ```bash
998
- indraq deploy:dev
1245
+ java -version
999
1246
  ```
1000
1247
 
1001
- The deployment command waits for Jenkins and streams its console output.
1248
+ Install Java 21 and reopen VS Code.
1002
1249
 
1003
- ### What happens if Jenkins fails?
1250
+ ---
1004
1251
 
1005
- The command exits as failed. The Docker image may already be in GHCR because Jenkins is intentionally triggered **after** a successful image push. The Jenkins error remains visible in your terminal for debugging.
1252
+ ### `tar is required`
1006
1253
 
1007
- ### What if the Jenkins job does not exist?
1254
+ Check:
1008
1255
 
1009
- The CLI checks before building the Docker image and stops with a clear error.
1256
+ ```bash
1257
+ tar --version
1258
+ ```
1010
1259
 
1011
- ### Why does Jenkins job name have to equal image name?
1260
+ Modern Windows 10/11, macOS, and most Linux distributions already provide `tar`.
1012
1261
 
1013
- It keeps the first deployment system predictable. A developer can know the expected pipeline name without searching a mapping file or webhook configuration.
1262
+ Ubuntu/Debian:
1014
1263
 
1015
- ### Can development and production have different image names?
1264
+ ```bash
1265
+ sudo apt install -y tar
1266
+ ```
1016
1267
 
1017
- Yes. Image names and Dockerfile paths are environment-specific.
1268
+ ---
1269
+
1270
+ ### `You are not in a mobile project root`
1018
1271
 
1019
1272
  Run:
1020
1273
 
1021
1274
  ```bash
1022
- indraq configure
1275
+ ls
1023
1276
  ```
1024
1277
 
1025
- Select Development or Production, then change only the setting you need from the configuration menu. When you are done, choose **Exit configuration**.
1278
+ or on PowerShell:
1026
1279
 
1027
- ### Can both environments use the same Jenkins server?
1280
+ ```powershell
1281
+ Get-ChildItem
1282
+ ```
1028
1283
 
1029
- Yes. Jenkins server configuration is project-level; each environment's image name decides which matching job is triggered.
1284
+ The current directory must contain:
1030
1285
 
1031
- ### Are Jenkins secrets stored in `deploy.json`?
1286
+ ```text
1287
+ package.json
1288
+ ```
1032
1289
 
1033
- No. The project config contains the Jenkins URL, username, server ID, and connection mode. The secret is stored separately in the local IndraQ cache.
1290
+ For React Native CLI it must also contain:
1291
+
1292
+ ```text
1293
+ android/
1294
+ android/gradlew
1295
+ ```
1034
1296
 
1035
1297
  ---
1036
1298
 
1037
- ## Final checklist
1299
+ ### `expo-dev-client is not installed`
1300
+
1301
+ For Expo Development Client:
1302
+
1303
+ ```bash
1304
+ npx expo install expo-dev-client
1305
+ ```
1038
1306
 
1039
- Before calling a machine ready for IndraQ deployments, confirm:
1040
-
1041
- - [ ] Node.js 24 is installed.
1042
- - [ ] `indraq --version` works.
1043
- - [ ] Git authentication works.
1044
- - [ ] Docker is installed and running.
1045
- - [ ] Java is installed and `java -version` works.
1046
- - [ ] First-time `indraq configure` completes successfully.
1047
- - [ ] Running `indraq configure` again opens the selective settings menu instead of the full wizard.
1048
- - [ ] Jenkins credentials pass the `who-am-i` check.
1049
- - [ ] The correct GitHub personal account or organization is selected.
1050
- - [ ] Development image name matches its Jenkins job name.
1051
- - [ ] Production image name matches its Jenkins job name.
1052
- - [ ] The project has the expected Dockerfile.
1053
- - [ ] The Jenkins user has read/build permission.
1054
- - [ ] GHCR push permission exists for the selected owner.
1055
- - [ ] `indraq deploy:dev` can build, push, run Jenkins, and show logs.
1056
- - [ ] Production is tested deliberately before relying on it for releases.
1307
+ Then retry.
1057
1308
 
1058
1309
  ---
1059
1310
 
1060
- ## Future modules
1311
+ ### `.env was not found`
1061
1312
 
1062
- Deployment is only the beginning. The CLI structure is intentionally ready for internal commands such as:
1313
+ Create:
1063
1314
 
1064
1315
  ```text
1065
- indraq db:backup
1066
- indraq db:migrate
1067
- indraq server:health
1068
- indraq server:deploy
1069
- indraq docker:clean
1070
- indraq secrets:check
1071
- indraq diagnostics
1316
+ <project-root>/.env
1072
1317
  ```
1073
1318
 
1074
- These names are examples, not implemented commands yet.
1319
+ Do not paste it into Jenkins.
1075
1320
 
1076
- The principle is:
1321
+ ---
1077
1322
 
1078
- ```text
1079
- One IndraQ CLI
1080
- ├── deployment operations
1081
- ├── infrastructure operations
1082
- ├── database operations
1083
- ├── diagnostics
1084
- ├── security helpers
1085
- └── future engineering automation
1086
- ```
1323
+ ### Jenkins HTTP 400 / file parameter error
1324
+
1325
+ Make sure:
1326
+
1327
+ 1. Jenkins **File Parameter** plugin is installed;
1328
+ 2. the job uses `templates/jenkins/Jenkinsfile-Mobile-App` from v1.5.1;
1329
+ 3. Jenkins has registered the parameters;
1330
+ 4. the Jenkins job is named exactly `Mobile app Cli build`.
1087
1331
 
1088
1332
  ---
1089
1333
 
1090
- <p align="center">
1091
- <img src="docs/assets/indraq-mark.png" alt="IndraQ" width="72" />
1092
- </p>
1334
+ ### Jenkins job not found
1093
1335
 
1094
- <p align="center">
1095
- <strong>Built by IndraQ Innovations for engineering operations.</strong><br/>
1096
- Make repetitive engineering work predictable, visible, and difficult to misuse.
1097
- </p>
1336
+ For mobile, the job name is fixed. In Jenkins, create or rename the Pipeline to exactly:
1098
1337
 
1099
- ---
1338
+ ```text
1339
+ Mobile app Cli build
1340
+ ```
1341
+
1342
+ Then make sure `indraq configure → Jenkins → Production` points at that Jenkins controller and that this computer has valid Jenkins credentials.
1100
1343
 
1101
- ## Windows command popup / command-name collision
1344
+ For Docker, the Jenkins job name must match the configured image name.
1102
1345
 
1103
- If typing `indraq` opens **Choose an app** or produces no CLI output, Windows is resolving another file named `IndraQ` before npm's launcher. This happens before Node or this CLI starts, so application code cannot intercept it.
1346
+ ---
1347
+
1348
+ ### `indraq` opens another Windows file/application
1104
1349
 
1105
1350
  Run:
1106
1351
 
1107
1352
  ```powershell
1108
1353
  where.exe indraq
1354
+ indraq doctor
1109
1355
  ```
1110
1356
 
1111
- The npm launcher should be the first result, normally `C:\Users\<you>\AppData\Roaming\npm\indraq.cmd`.
1112
-
1113
- The published npm package is named `indraq_cli`, but the executable it installs is intentionally named `indraq`. Inspect any path listed before npm's `indraq` launcher. Do **not** delete an unfamiliar file blindly. If it is an old IndraQ test file, rename/remove it and open a new terminal. Then `indraq configure` and `indraq deploy:dev` should work normally.
1357
+ The npm launcher should be the first `indraq` result.
1114
1358
 
1115
1359
  ---
1116
1360
 
1117
- ## Publishing and npm organization management
1118
-
1119
- This section is for IndraQ CLI maintainers. Normal users do **not** need these commands.
1361
+ ### npm shows `EEXIST` for `indraq.ps1`
1120
1362
 
1121
- ### Package name and terminal command
1363
+ This usually means an old `npm link` launcher is still present.
1122
1364
 
1123
- The npm package name is:
1365
+ Remove the old global development link/package, then reinstall:
1124
1366
 
1125
- ```text
1126
- indraq_cli
1367
+ ```powershell
1368
+ npm unlink -g indraq_cli
1369
+ npm uninstall -g indraq_cli
1370
+ npm install -g indraq_cli
1127
1371
  ```
1128
1372
 
1129
- Users install it with:
1373
+ ---
1374
+
1375
+ ## Frequently asked questions
1376
+
1377
+ ### Do I install IndraQ CLI in every project?
1378
+
1379
+ No. Install globally once per computer:
1130
1380
 
1131
1381
  ```bash
1132
1382
  npm install -g indraq_cli
1133
1383
  ```
1134
1384
 
1135
- The installed terminal command is still:
1385
+ Each project only gets its own `.indraq/` configuration.
1386
+
1387
+ ### Does the mobile build require me to push my latest code to Git first?
1388
+
1389
+ No. The mobile builder snapshots the files currently on disk. Uncommitted changes are included.
1390
+
1391
+ ### Does Jenkins need access to my GitHub repository for mobile builds?
1392
+
1393
+ Not for the v1.5 source-upload pipeline. The CLI sends the source snapshot directly.
1394
+
1395
+ ### Does Docker deployment still use GitHub/GHCR?
1396
+
1397
+ Yes. Docker builds continue to push images to GHCR and then run the configured Jenkins deployment job.
1398
+
1399
+ ### Can Staging and Production have different mobile outputs?
1400
+
1401
+ Yes. Example:
1402
+
1403
+ ```text
1404
+ Staging: Release APK / FAST
1405
+ Production: Release AAB / CLEAN
1406
+ ```
1407
+
1408
+ ### Can I build an APK once without changing my saved Production AAB default?
1409
+
1410
+ Yes:
1136
1411
 
1137
1412
  ```bash
1138
- indraq
1413
+ indraq build mobile:prod --output apk
1139
1414
  ```
1140
1415
 
1141
- The npm package name and the executable name do not have to be identical.
1416
+ The saved default remains unchanged.
1142
1417
 
1143
- ### Before publishing a release
1418
+ ### Does IndraQ save `.env`?
1144
1419
 
1145
- A freshly extracted source archive does not contain `node_modules`. Install the exact development dependencies first so the TypeScript compiler is available:
1420
+ No. It reads the root `.env` at build time and uploads it separately when required.
1146
1421
 
1147
- ```bash
1148
- npm ci
1149
- npm run build
1150
- npm publish --dry-run
1422
+ ### When does Version/versionCode increment?
1423
+
1424
+ After a **successful** Jenkins mobile build. The build uses the currently saved values first, then enabled counters advance for the next build. Failed/cancelled builds do not consume values.
1425
+
1426
+ ### Can I turn auto-increment off?
1427
+
1428
+ Yes:
1429
+
1430
+ ```text
1431
+ indraq configure
1432
+ → Mobile App
1433
+ → Version & versionCode
1151
1434
  ```
1152
1435
 
1153
- If `npm publish --dry-run` reports `tsc is not recognized`, `npm ci` was not run successfully in that source folder.
1436
+ Version and versionCode have separate switches. When either is OFF, the build continues but IndraQ prints a reminder warning.
1154
1437
 
1155
- Then verify the account that will publish:
1438
+ ### What timezone is used in APK/AAB filenames?
1156
1439
 
1157
- ```bash
1158
- npm whoami
1440
+ Always `Asia/Kolkata` (IST), using `YYYY-MM-DD_HHmm`.
1441
+
1442
+ ### Which Jenkins does Mobile use?
1443
+
1444
+ **Production Jenkins only.** This is intentional.
1445
+
1446
+ ```text
1447
+ mobile:dev → Production Jenkins
1448
+ mobile:staging → Production Jenkins
1449
+ mobile:prod → Production Jenkins
1159
1450
  ```
1160
1451
 
1161
- For a real release:
1452
+ The mobile Development/Staging/Production selection controls the app build environment and allowed output. It does not select a Jenkins controller.
1162
1453
 
1163
- ```bash
1164
- npm publish --access public
1454
+ ### Why can Docker use Development and Production Jenkins?
1455
+
1456
+ Docker deployments represent infrastructure environments. `indraq deploy:dev` can deploy through Development Jenkins while `indraq deploy:prod` can use Production Jenkins. Mobile builds are build jobs rather than Docker environment deployments, so they always use the single Production Jenkins path.
1457
+
1458
+ ---
1459
+
1460
+ ## Project architecture
1461
+
1462
+ ```text
1463
+ src/
1464
+ ├── cli/
1465
+ │ ├── create-program.ts
1466
+ │ └── doctor.command.ts
1467
+
1468
+ ├── modules/
1469
+ │ ├── configure/
1470
+ │ │ └── configure.command.ts
1471
+ │ │
1472
+ │ ├── deploy/
1473
+ │ │ ├── commands/
1474
+ │ │ ├── config/
1475
+ │ │ └── services/
1476
+ │ │
1477
+ │ └── mobile/
1478
+ │ ├── commands/
1479
+ │ │ ├── configure-mobile.command.ts
1480
+ │ │ └── build-mobile.command.ts
1481
+ │ ├── config/
1482
+ │ │ └── mobile-config.ts
1483
+ │ └── services/
1484
+ │ ├── project.service.ts
1485
+ │ ├── source-bundle.service.ts
1486
+ │ └── jenkins-mobile.service.ts
1487
+
1488
+ └── shared/
1489
+ ├── config/
1490
+ ├── git/
1491
+ ├── github/
1492
+ ├── jenkins/
1493
+ └── runtime/
1494
+
1495
+ templates/
1496
+ └── jenkins/
1497
+ └── Jenkinsfile-Mobile-App
1165
1498
  ```
1166
1499
 
1167
- Unscoped npm packages such as `indraq_cli` are public.
1500
+ This is intentional. Future modules can be added without dumping unrelated logic into the deployment module.
1168
1501
 
1169
- ### Let the IndraQ npm organization manage the package
1502
+ Possible future commands:
1170
1503
 
1171
- `indraq_cli` stays unscoped so users keep the simple install command `npm install -g indraq_cli`. After the first publish, an npm organization owner/package maintainer can grant an organization team access to this existing package.
1504
+ ```text
1505
+ indraq database ...
1506
+ indraq backup ...
1507
+ indraq server ...
1508
+ indraq secrets ...
1509
+ indraq diagnostics ...
1510
+ ```
1172
1511
 
1173
- In npm's website:
1512
+ ---
1174
1513
 
1175
- 1. Open the **indraq_innovations** organization.
1176
- 2. Open **Teams**.
1177
- 3. Open the team that should maintain the CLI (for example, `developers`).
1178
- 4. Open **Packages**.
1179
- 5. Choose **Add Existing Package**.
1180
- 6. Select `indraq_cli`.
1181
- 7. Give the team **read/write** access if that team should be able to publish future versions.
1514
+ ## Final checklist
1182
1515
 
1183
- This gives the organization team management access without changing the public package name or install command.
1516
+ ### Developer machine
1517
+
1518
+ - [ ] Node.js 22+ installed
1519
+ - [ ] npm installed
1520
+ - [ ] Java available with `java -version`
1521
+ - [ ] Git installed
1522
+ - [ ] `tar` available
1523
+ - [ ] Docker installed if using Docker deployment
1524
+ - [ ] `npm install -g indraq_cli` completed
1525
+ - [ ] `indraq doctor` passes
1526
+
1527
+ ### Docker deployment project
1528
+
1529
+ - [ ] `indraq configure → Jenkins → Development/Production`
1530
+ - [ ] `indraq configure → Docker / GHCR`
1531
+ - [ ] Dockerfile exists
1532
+ - [ ] GitHub/GHCR authentication works
1533
+ - [ ] Jenkins deployment job names match image names
1534
+
1535
+ ### Mobile project
1536
+
1537
+ - [ ] command is run from package.json root
1538
+ - [ ] Production Jenkins connection configured (`indraq configure → Jenkins → Production`)
1539
+ - [ ] Jenkins File Parameter plugin installed
1540
+ - [ ] Jenkins job uses the v1.5.1 mobile Jenkinsfile
1541
+ - [ ] Mobile project type configured
1542
+ - [ ] Jenkins job is named exactly `Mobile app Cli build` and exists on Production Jenkins
1543
+ - [ ] Development / Staging / Production defaults configured as needed
1544
+ - [ ] root `.env` exists for APK/AAB/debug builds
1545
+ - [ ] Expo Development Client has `expo-dev-client`
1546
+ - [ ] `.indraq/mobile.json` is not ignored and is committed so Version/versionCode survive across developers
1184
1547
 
1185
1548
  ---
1186
1549
 
1187
1550
  ## License
1188
1551
 
1189
- IndraQ CLI is released under the [MIT License](LICENSE). You may use, copy, modify, and distribute it under the terms of that license.
1552
+ MIT License. See [`LICENSE`](LICENSE).
1190
1553
 
1191
- > IndraQ CLI is not affiliated with or endorsed by Jenkins, Docker, GitHub, or npm. Those names belong to their respective owners.
1554
+ <p align="center">
1555
+ <img src="docs/assets/indraq-mark.png" alt="IndraQ" width="72" />
1556
+ </p>
1557
+
1558
+ <p align="center">
1559
+ <strong>Built and maintained by IndraQ Innovations.</strong>
1560
+ </p>