Suspending and Resuming
Feature Overview: iFlow CLI allows you to suspend (pause) an interactive session and resume it later when you're ready. (Currently only supported on macOS/Linux)
Learning Time: 5 minutes
Prerequisites: Familiarity with basic command-line operations such as
ctrl+zandfg.
What Is Suspending and Resuming?
During an iFlow CLI interactive session, you may need to temporarily step away from the current task to handle something more urgent. The suspend and resume feature lets you use standard terminal commands to pause your current iFlow session and pick up right where you left off when you're ready.
This feature relies on the job control capabilities built into most modern shells (such as Bash and Zsh).
Core Operations
| Operation | Command | Description |
|---|---|---|
| Suspend | ctrl+z | Pauses the iFlow process running in the foreground and moves it to the background. |
| Resume | fg or fg %<job_number> | Brings a background task back to the foreground. fg resumes the most recently suspended task by default. Use fg %1, fg %2, etc. to resume a specific task. |
You can use the jobs command to list all background tasks along with their job numbers.
Workflow
- Start an interactive session: Run
iflowto enter interactive mode. - Work on a task: Interact with iFlow in the session — for example, run a playbook or ask a question.
- Need to step away: Suppose you need to check another file or run a quick command without terminating the current iFlow session.
- Suspend the session: Press
ctrl+z. The iFlow CLI process will be paused, and you'll be dropped back to your shell prompt. - Do other work: Run any commands you need in the shell.
- Resume the session: When you're ready to return to iFlow, type
fg. - Continue where you left off: You'll be brought back to the exact point in your iFlow session where you paused.
Use Cases
- Quick lookups: While conversing with iFlow, you need to quickly check a file's contents or verify some information.
- Running system commands: You need to run a command (like
git statusorls -l) to gather context before continuing your conversation with iFlow. - Multitasking: Manage multiple tasks in a single terminal window without opening a new tab for each one.
Example
Suppose you're using iFlow to write code:
-
Start iFlow:
iflowYou enter iFlow's interactive session.
-
Begin a task:
>>> "Write a python hello world"iFlow starts generating code.
-
Need to check something: You suddenly realize you should check whether a
hello.pyfile already exists in the current directory. -
Suspend iFlow: Press
ctrl+z.zsh: suspended iflowYou're back at the Zsh (or your default shell) prompt.
-
Check the file:
lsYou confirm there's no
hello.pyin the directory. -
Resume iFlow: Type
fg.fg
[1] + continued iflowYou're back in the iFlow session. iFlow restores your previous conversation history and is ready for your next instruction.
This feature makes iFlow CLI more flexible, letting it fit seamlessly into your existing command-line workflow.