hlix init
Reference for hlix init — the files it writes, what it verifies first, and how it differs from import.
hlix init prepares a local folder for the CLI. It writes project configuration and scans the folder. Use hlix import to create the cloud project and upload its files.
Prerequisites
Section titled “Prerequisites”- A credential that names a workspace (see
hlix auth login) - A directory you are authorized to scan
hlix init [folder] [--project <id>] [--json]Arguments
Section titled “Arguments”folder(string, optional, default.): the directory to initialize, resolved against--cwd. At most one may be given; a second exitsinvalid_usage.
--project(string, optional): bind the folder to a project that already exists in this workspace, instead of leaving it unbound. It refuses a folder already bound to a different project. Afterwards,hlix pullbrings the project’s files down — or, when the project has no source files yet,hlix pushuploads this folder as its first.--json(boolean, defaultfalse): return{ root, config, scan }, wherescancarriesfiles,bytes,secretFiles,quarantinedResources, andblocking. Paths and counts only — no secret values.
Expected result:
Initialized /absolute/path/to/projectProject: not imported yetWorkspace: org_2p9xk4What it writes
Section titled “What it writes”| Path | Purpose | Commit it? |
|---|---|---|
hlix.yml |
The project file. hlix.workspace and hlix.project bind the folder. hlix.api is written only when the server is not https://server.hlix.ai; a missing key means that host. The rest is Cloud Machine size, setup, preview, verification, and environment variable names. Secret values stay out of it. An existing file keeps its project setup. Init fills a missing hlix: block and leaves the rest. |
Yes |
.hlix/.gitignore |
Keeps local synchronization state out of Git | Yes |
.hlix/state.json |
Last synchronized repository, commit, and file identities | No; created by import or first sync |
.hlixignore |
Project-local additions to the snapshot ignore list | Yes |
Conflicts and validation
Section titled “Conflicts and validation”- The target is resolved at the folder being initialized, not the shell’s working directory. An override that contradicts that folder’s existing binding exits
workspace_mismatchbefore anything is written. - If no source in the target chain names a Workspace, the command fails:
No workspace selected. Run `hlix auth login --workspace <id>` first. - The CLI verifies the credential before writing the folder binding.
- An existing
hlix.ymlkeeps its project setup. Init fills a missinghlix:block and leaves the rest.hlix.apiis written only when the server is nothttps://server.hlix.ai. The folder binding must match the selected Workspace, API and project. - Init appends
hlix.local.ymlandhlix.local.yamlto.gitignorewhen those lines are missing. A local file overrideshlix.ymlon that machine only. Import uploads the current tree, so ahlix.local.ymlthat was already committed stays in older history under--history preserve. Use--history sanitizewhen that file was committed. Init does not create the local file. - Use a regular directory for
.hlix. - Scan blockers are reported, not fatal:
initprints them underReview before import:and still exits0. They become blocking athlix import.
If init fails
Section titled “If init fails”No workspace selected. Run `hlix auth login --workspace <id>` first.— nothing in the resolution chain named a workspace.workspace_mismatch— a--workspace,--base-url, orHLIX_*value contradicts the binding of the folder being initialized. The message names both sides. Drop the override rather than editing thehlix:block, and use a folder bound to the intended project.Refusing to write through a symlinked …— replace the symlinked.hlixpath with a real directory you own.unauthenticated— the stored credential no longer works. Runhlix auth loginagain.invalid_usage— more than one folder argument was given.