You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/edit/usage.rst
+61-1Lines changed: 61 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,67 @@ The command line could also works without internet by providing the country code
58
58
59
59
codecarbon monitor --offline --country-iso-code FRA
60
60
61
-
Implementing CodeCarbon in your code allows you to track the emissions of a specific block of code.
61
+
62
+
Running Any Command with CodeCarbon
63
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
+
65
+
If you want to track emissions while running any command or program (not just Python scripts), you can use the ``codecarbon run`` command.
66
+
This allows non-Python users to measure machine emissions during the execution of any command:
67
+
68
+
.. code-block:: console
69
+
70
+
codecarbon run -- <your_command>
71
+
72
+
Do not surround ``<your_command>`` with quotes. The double hyphen ``--`` indicates the end of CodeCarbon options and the beginning of the command to run.
73
+
74
+
**Examples:**
75
+
76
+
.. code-block:: console
77
+
78
+
# Run a shell script
79
+
codecarbon run -- ./benchmark.sh
80
+
81
+
# Run a command with arguments (use quotes for special characters)
0 commit comments