Skip to content

remove Yeoman and switched to Oclif for the CLI#640

Open
OsamaRab3 wants to merge 41 commits intohyperledger-labs:mainfrom
OsamaRab3:del-yeoman
Open

remove Yeoman and switched to Oclif for the CLI#640
OsamaRab3 wants to merge 41 commits intohyperledger-labs:mainfrom
OsamaRab3:del-yeoman

Conversation

@OsamaRab3
Copy link
Contributor

Description

This PR introduces the initial setup for removing and fully migrating the CLI to Oclif.
The goal is to simplify the CLI implementation, remove the generator dependency, and make future features easier to maintain and extend.

All commands are currently working as expected, but I haven’t run the full automated test suite yet

Current Progress

Implemented so far

  • Replaced Yeoman-based commands with Oclif commands.
  • Added the new init implementation using Oclif.
  • fablo init now accepts the following optional features (order does not matter):
fablo init [node] [dev] [rest] [ccaas] [gateway]
  • Added initial Oclif commands for:
    • up
    • down
    • start
    • stop
    • recreate
    • prune

Basic usage examples

Run the network:

ffablo up -c fablo-config.json

The -c flag is optional if omitted, it will default to fablo-config.json just like the original Fablo CLI

Important Note

  • I temporarily named the executable ffablo to avoid conflicts with the existing fablo command during development.
    Once the migration is complete and fully tested, the name will be switched back to fablo
  • I haven’t removed the old Yeoman-based code yet.
    Once the new Oclif implementation is fully completed and fully tested, I will remove all legacy code.

@OsamaRab3
Copy link
Contributor Author

To run and test it locally, please follow these steps

npm install
npm run build
npm link

Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
dzikowski and others added 10 commits December 5, 2025 15:50
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
package.json Outdated
Comment on lines +84 to +86
"bin": "ffablo",
"commands": "./generators/commands",
"dirname": "ffablo",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"bin": "ffablo",
"commands": "./generators/commands",
"dirname": "ffablo",
"bin": "fablo",
"commands": "./generators/commands",
"dirname": "fablo",

src/app/index.ts Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we no longer need this file since we have migrated away from Yeoman. It does not seem to be used anywhere, so we can safely remove it.

package.json Outdated
Comment on lines +25 to +27
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "npm run lint",
"prepack": "oclif manifest && oclif readme",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these scripts?

Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
fablo.sh Outdated
}

executeOnFabloDocker() {
# set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we can remove that line

fablo.sh Outdated
Comment on lines +202 to +213
if [ -f /etc/passwd ]; then
fablo_workspace_params+=(
-v /etc/passwd:/etc/passwd:ro
)
fi

if [ -f /etc/group ]; then
fablo_workspace_params+=(
-v /etc/group:/etc/group:ro
)
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does it do? do we need it?


if [ -f "$FABLO_TARGET/fabric-docker.sh" ]; then
echo "Executing Fablo Docker command: $1"
chmod +x "$FABLO_TARGET/fabric-docker.sh" || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should not be required. We should grant x permission when the file is created

Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
@mergify mergify bot mentioned this pull request Mar 6, 2026
dzikowski and others added 4 commits March 6, 2026 18:55
…f they exist

Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
…g and adjust output directories

Signed-off-by: OsamaRab3 <osrab3@gmail.com>
@OsamaRab3 OsamaRab3 requested a review from dzikowski March 6, 2026 22:58
…ted minimal files for security

Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants