grace init
Scaffold a new Grace workflow.
The grace init
command scaffolds a new Grace workflow directory structure, making it easy to get started with a new project.
It creates a standard layout including a starter grace.yml
configuration file, a src/
directory for your source code (like COBOL programs), and a .grace/
directory for Grace's operational outputs like generated JCL decks and logs.
Usage
Arguments
Arguments
-
[workspace-name]
(optional):- If provided, Grace creates a new subdirectory with this name and scaffolds the workflow inside it.
- If omitted, Grace attempts to initialize the workflow in the current directory. The workflow name for configuration purposes will default to the name of the current directory.
Flags
--tutorial
- Optional boolean flag.
- If specified,
grace init
scaffolds a pre-configured "Hello, Grace" tutorial workflow. This includes:- A
grace.yml
file with sample compile, link-edit, and execute jobs. - A
src/hello.cbl
COBOL program.
- A
- This is a great way to quickly get a runnable example.
- Example:
grace init my-first-workflow --tutorial
-h, --help
- Displays help information for the init command.
Interactive Prompt
When you run grace init
(without --tutorial
and potentially without a workspace-name
if you want to configure the current directory), it launches an interactive TUI (Text-based User Interface) to help you populate key fields in the generated grace.yml
:
- Workflow Name:
- If you provided
[workspace-name]
on the command line, this field will be pre-filled with that name. - If you didn't provide [workspace-name], it defaults to the current directory's name (you can change it). If you accept the default to use the current directory, Grace will initialize files directly in CWD.
- This name is used for the directory (if creating a new one) and as a default for some internal naming if not overridden elsewhere.
- HLQ (High-Level Qualifier):
- The high-level qualifier your site uses for creating datasets (e.g., MYUSER, PROJ001).
- This will populate
datasets.jcl
,datasets.src
, anddatasets.loadlib
ingrace.yml
using a pattern likeHLQ.WORKFLOW_NAME.JCL
. - Defaults to IBMUSER if left blank.
- Profile (Zowe CLI Profile):
- The name of the Zowe CLI profile Grace should use to connect to your z/OS system (e.g.,
zosmf
,my_lpar_profile
). - This populates
config.profile
ingrace.yml
. - Defaults to
zosmf
if left blank.
You can navigate between fields using
Tab / Shift+Tab
or Arrow Keys, and submit withEnter
. PressEsc
orCtrl+C
to cancel.
What it creates
Assuming you run grace init my_workflow_proj
:
If run without [workspace-name]
in an existing directory, these files/folders will be scattered directly in the current location (Grace will warn if it's about to overwrite existing files/directories like .grace
or src
).
After grace init
- Navigate into your new workflow directory (if one was created).
- Review and edit
grace.yml
:- Crucially, ensure
config.profile
matches your working Zowe CLI profile. - Adjust
datasets
(JCL, SRC, LOADLIB HLQs and names) to suit your z/OS environment and naming conventions. - Verify
config.defaults.compiler
andconfig.defaults.linker
settings (PGM names, PARMs, STEPLIBs) match your site's COBOL compiler and Linkage Editor.
- Crucially, ensure
- Add source files: Place your COBOL programs or other source files into the
src/
directory. - Validate: Run
grace lint
to check yourgrace.yml
for syntax and structural correctness.
You are now ready to define jobs and use commands like grace deck
and grace run
.