Grace LogoGrace

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

grace init [workspace-name] [flags]

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.
  • 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:

  1. 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.
  1. 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, and datasets.loadlib in grace.yml using a pattern like HLQ.WORKFLOW_NAME.JCL.
  • Defaults to IBMUSER if left blank.
  1. 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 in grace.yml.
  • Defaults to zosmf if left blank.

You can navigate between fields using Tab / Shift+Tab or Arrow Keys, and submit with Enter. Press Esc or Ctrl+C to cancel.


What it creates

Assuming you run grace init my_workflow_proj:

my_workflow_proj/
├── .grace/               # Internal directory for Grace operations
   ├── deck/             # Stores JCL generated by 'grace deck'
   └── logs/             # Stores logs and summaries from 'grace run/submit'
├── src/                  # Place your COBOL, PL/I, etc. source files here
   └── (empty or tutorial files if --tutorial is used)
└── grace.yml             # Your main workflow definition file

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

  1. Navigate into your new workflow directory (if one was created).
  2. 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 and config.defaults.linker settings (PGM names, PARMs, STEPLIBs) match your site's COBOL compiler and Linkage Editor.
  3. Add source files: Place your COBOL programs or other source files into the src/ directory.
  4. Validate: Run grace lint to check your grace.yml for syntax and structural correctness.

You are now ready to define jobs and use commands like grace deck and grace run.

On this page