workspace_sandbox 0.1.3 copy "workspace_sandbox: ^0.1.3" to clipboard
workspace_sandbox: ^0.1.3 copied to clipboard

Cross-platform sandboxed workspace manager for running shell commands with streaming output and native isolation.

example/example.dart

import 'package:workspace_sandbox/workspace_sandbox.dart';

/// Demonstrates basic workspace operations.
///
/// This example shows how to:
/// - Create an ephemeral workspace
/// - Write files
/// - Execute shell commands
/// - Read command results
void main() async {
  final ws = Workspace.ephemeral();

  try {
    print('Workspace created at: ${ws.rootPath}');

    print('\nStep 1: Creating a file...');
    await ws.writeFile('hello.txt', 'Hello from Sandbox!');

    print('Step 2: Running a command...');
    final result = await ws.run('grep "Hello" hello.txt');

    if (result.exitCode == 0) {
      print('Command succeeded: ${result.stdout.trim()}');
    } else {
      print('Command failed: ${result.stderr}');
    }
  } finally {
    await ws.dispose();
    print('\nWorkspace cleaned up.');
  }
}
3
likes
0
points
120
downloads

Publisher

unverified uploader

Weekly Downloads

Cross-platform sandboxed workspace manager for running shell commands with streaming output and native isolation.

Repository (GitHub)
View/report issues

Topics

#sandbox #process #isolation #command-execution #security

License

unknown (license)

Dependencies

http, path

More

Packages that depend on workspace_sandbox