Skip to content

Commit 9807c30

Browse files
committed
refactor(cli): use ui Android mobile core
1 parent 5d50139 commit 9807c30

3 files changed

Lines changed: 160 additions & 581 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ if (EXISTS "${_VIX_NOTE_DIR}/CMakeLists.txt" AND NOT TARGET vix::note)
168168
add_subdirectory("${_VIX_NOTE_DIR}" "${CMAKE_BINARY_DIR}/_vix_note")
169169
endif()
170170

171-
if (VIX_CLI_ENABLE_DESKTOP AND EXISTS "${_VIX_UI_DIR}/CMakeLists.txt" AND NOT TARGET vix::ui)
171+
if (EXISTS "${_VIX_UI_DIR}/CMakeLists.txt" AND NOT TARGET vix::ui)
172172
set(VIX_UI_BUILD_TESTS OFF CACHE BOOL "" FORCE)
173173
set(VIX_UI_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
174174
set(VIX_UI_INSTALL OFF CACHE BOOL "" FORCE)
@@ -380,7 +380,7 @@ else()
380380
list(APPEND _VIX_LOCAL_LINK_TARGETS vix::note)
381381
endif()
382382

383-
if (VIX_CLI_ENABLE_DESKTOP AND TARGET vix::ui)
383+
if (TARGET vix::ui)
384384
list(APPEND _VIX_LOCAL_LINK_TARGETS vix::ui)
385385
endif()
386386

@@ -402,9 +402,7 @@ else()
402402
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_WEBSOCKET_DIR}/include")
403403
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_P2P_DIR}/include")
404404
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_NOTE_DIR}/include")
405-
if (VIX_CLI_ENABLE_DESKTOP)
406-
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_UI_DIR}/include")
407-
endif()
405+
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_UI_DIR}/include")
408406

409407
if (_VIX_LOCAL_LINK_TARGETS)
410408
list(REMOVE_DUPLICATES _VIX_LOCAL_LINK_TARGETS)
@@ -540,20 +538,19 @@ endif()
540538
# ----------------------------------------------------
541539
# Optional UI desktop command support
542540
# ----------------------------------------------------
543-
if (VIX_CLI_ENABLE_DESKTOP AND TARGET vix::ui)
544-
message(STATUS "[cli] UI desktop command enabled")
541+
if (TARGET vix::ui)
542+
message(STATUS "[cli] UI mobile core enabled")
545543
target_link_libraries(vix_cli PRIVATE vix::ui)
546-
target_compile_definitions(vix_cli PRIVATE VIX_CLI_HAS_UI=1)
544+
545+
if (VIX_CLI_ENABLE_DESKTOP)
546+
target_compile_definitions(vix_cli PRIVATE VIX_CLI_HAS_UI=1)
547+
endif()
547548

548549
if (VIX_UI_ENABLE_LINUX_WEBVIEW)
549550
target_compile_definitions(vix_cli PRIVATE VIX_UI_ENABLE_LINUX_WEBVIEW=1)
550551
endif()
551552
else()
552-
if (VIX_CLI_ENABLE_DESKTOP)
553-
message(STATUS "[cli] UI desktop command disabled: vix::ui target not found")
554-
else()
555-
message(STATUS "[cli] UI desktop command disabled: VIX_CLI_ENABLE_DESKTOP=OFF")
556-
endif()
553+
message(FATAL_ERROR "[cli] vix::ui is required by the mobile command")
557554
endif()
558555

559556
# ----------------------------------------------------

‎README.md‎

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Official command-line interface for Vix.cpp.
44

5-
The Vix CLI provides a modern developer workflow for C++ projects: create, build, run, test, format, manage dependencies, inspect the environment, and package applications.
5+
The Vix CLI provides a modern developer workflow for C++ projects: create, build, run, test, format, manage dependencies, inspect the environment, package applications, and deploy projects.
66

77
## Documentation
88

9-
Full documentation is available here:
9+
Full CLI documentation:
1010

1111
https://docs.vixcpp.com/cli/
1212

13-
## Main commands
13+
## Quick start
1414

1515
```bash
1616
vix new app
@@ -19,10 +19,17 @@ vix install
1919
vix dev
2020
```
2121

22+
Build and run:
23+
2224
```bash
2325
vix build
2426
vix run
25-
vix tests
27+
```
28+
29+
Run tests and checks:
30+
31+
```bash
32+
vix test
2633
vix check
2734
vix fmt
2835
```
@@ -35,6 +42,12 @@ Run a single C++ file directly:
3542
vix run main.cpp
3643
```
3744

45+
You can also run a C++ file directly:
46+
47+
```bash
48+
vix main.cpp
49+
```
50+
3851
## Dependency management
3952

4053
```bash
@@ -60,13 +73,107 @@ More information:
6073

6174
https://docs.vixcpp.com/cli/info
6275

76+
## CLI help
77+
78+
```text
79+
$ vix -h
80+
81+
Usage:
82+
vix <command> [options]
83+
vix <file.cpp>
84+
vix help <command>
85+
86+
Common commands:
87+
new <name> Create a new Vix project
88+
init Initialize the current directory
89+
add <package> Add a dependency
90+
install Install project dependencies
91+
run Build and run a project or C++ file
92+
dev Start development mode
93+
build Configure and build
94+
test Run project tests
95+
deploy Deploy the application
96+
97+
Project:
98+
make Generate C++ scaffolding
99+
check Validate a project or source file
100+
replay Replay a recorded execution
101+
repl Start the interactive REPL
102+
task Run project tasks
103+
fmt Format C++ source files
104+
clean Remove local build caches
105+
reset Reset caches and dependencies
106+
modules Manage optional project modules
107+
108+
Applications:
109+
note Open a Vix Note document
110+
desktop Run a web application as desktop
111+
mobile Generate mobile WebView shells
112+
game Manage Vix game projects
113+
agent Run the local-first Vix AI agent
114+
115+
Production:
116+
production Show production status
117+
service Manage the system service
118+
proxy Manage reverse proxy configuration
119+
health Check application health
120+
logs Show application and proxy logs
121+
env Validate environment variables
122+
ws Diagnose WebSocket endpoints
123+
124+
Dependencies and registry:
125+
registry Manage the registry index
126+
search <query> Search registry packages
127+
list List project dependencies
128+
remove <package> Remove a dependency
129+
update Update dependencies
130+
outdated Check outdated dependencies
131+
store Manage the local package store
132+
publish Publish a package version
133+
unpublish Remove a published version
134+
135+
Packaging:
136+
pack Create a distributable package
137+
verify Verify package integrity
138+
cache Cache a package locally
139+
140+
Cloud:
141+
login Connect to Softadastra Cloud
142+
logout Remove the local cloud session
143+
cloud Manage Cloud project links
144+
doctor --cloud Diagnose Cloud connectivity
145+
146+
Data and networking:
147+
db Inspect SQLite databases
148+
orm Manage database migrations
149+
p2p Run P2P tools
150+
151+
System:
152+
doctor Check the installation and toolchain
153+
info Show environment information
154+
completion Generate shell completions
155+
upgrade Upgrade the Vix CLI
156+
uninstall Uninstall the Vix CLI
157+
158+
Global options:
159+
--verbose Enable debug output
160+
-q, --quiet Only show warnings and errors
161+
--log-level <level> Set trace, debug, info, warn, error or critical
162+
-h, --help Show command help
163+
-v, --version Show the installed version
164+
165+
Run 'vix help <command>' for detailed command usage.
166+
Documentation: https://docs.vixcpp.com/cli/
167+
```
168+
63169
## Build
64170

65171
### Standalone CLI build
66172

67173
```bash
68174
git clone https://github.com/vixcpp/vix.git
69175
cd vix/modules/cli
176+
70177
cmake -B build -S .
71178
cmake --build build -j$(nproc)
72179
```
@@ -82,6 +189,7 @@ Run the binary:
82189
```bash
83190
git clone https://github.com/vixcpp/vix.git
84191
cd vix
192+
85193
cmake -B build -S .
86194
cmake --build build -j$(nproc)
87195
```

0 commit comments

Comments
 (0)