eSign Automation
by @esign-cn-open-source
Automate contract signing, esign, and signature workflows by calling the eSignGlobal CLI tool. The eSignGlobal CLI is agent-friendly, with JSON output by def...
clawhub install esign-automationπ About This Skill
name: esign-automation description: Automate contract signing, esign, and signature workflows by calling the eSignGlobal CLI tool. The eSignGlobal CLI is agent-friendly, with JSON output by default, making eSignGlobal signing operations easy to parse and chain. Supports creating draft envelopes, obtaining sender view URLs, sending envelopes, querying envelope details, sending reminders, cancelling envelopes, downloading signed files, verifying PDF signatures locally, rendering templates to generate documents for signing, comparing two PDF contracts side by side, managing envelope attachments, managing CC (carbon copy) recipients, and adding or removing signers from draft envelopes. metadata: {"openclaw":{"primaryEnv":"ESIGNGLOBAL_APIKEY"}} version: 1.7.5 homepage: https://github.com/esign-cn-open-source/skills
eSign Automation
This skill provides automation capabilities for the eSignGlobal electronic signature platform. It enables AI agents to automate document signing workflows and integrate with eSignGlobal APIs. This skill is maintained by the eSignGlobal team and is intended for safe automation of contract signing workflows.
Best For
Use this skill when the user wants to:
Example requests:
Installation
Use the external CLI through npx:
npx @esignglobal/envelope-cli
Setup
Before calling any send action, set ESIGNGLOBAL_APIKEY in the shell environment.
If the user does not already have an api key, direct them to:
1. Sign in at https://www.esignglobal.com?source=agent
2. Open Settings -> Integration -> Apps
3. Create an application and copy the generated api key
# Windows PowerShell
$env:ESIGNGLOBAL_APIKEY="your_api_key"macOS / Linux
export ESIGNGLOBAL_APIKEY="your_api_key"Verify connectivity
npx @esignglobal/envelope-cli config health
Credential handling rules:
ESIGNGLOBAL_APIKEYExternal CLI Pattern
Use the external command-line tool instead of bundled scripts:
npx @esignglobal/envelope-cli create-envelope --subject [--remark ] [--expire ] [--redirect-url ] [--callback-url ]
npx @esignglobal/envelope-cli sender-view --envelope-id --return-url [--starting-page ] [--submit-action ] [--no-back-button] [--lock ]
npx @esignglobal/envelope-cli send-envelope --file --signers '' [--subject ] --confirm
npx @esignglobal/envelope-cli send-envelope --file-key --signers '' [--subject ] --confirm
npx @esignglobal/envelope-cli get-template --template-id
npx @esignglobal/envelope-cli render-template --template-id [--file-name ] [--fields ''] [--callback-url ]
npx @esignglobal/envelope-cli get-render-result --task-id
npx @esignglobal/envelope-cli get-envelope --envelope-id
npx @esignglobal/envelope-cli urge-envelope --envelope-id
npx @esignglobal/envelope-cli cancel-envelope --envelope-id --reason --confirm
npx @esignglobal/envelope-cli download-envelope --envelope-id --type list
npx @esignglobal/envelope-cli verify-signature --file
npx @esignglobal/envelope-cli contract-compare (--standard-file | --standard-file-key ) (--comparative-file | --comparative-file-key ) [--filter-header-footer] [--filter-symbols ]
npx @esignglobal/envelope-cli add-attachments --envelope-id --file-keys ''
npx @esignglobal/envelope-cli delete-attachments --envelope-id --file-keys '' --confirm
npx @esignglobal/envelope-cli add-cc --envelope-id --cc-infos '[{"userEmail":"...","userName":"..."}]'
npx @esignglobal/envelope-cli delete-cc --envelope-id --cc-infos '[{"userEmail":"..."}]' --confirm
npx @esignglobal/envelope-cli add-signers --envelope-id --signers '[{"userName":"...","userEmail":"...","signOrder":1}]'
npx @esignglobal/envelope-cli delete-signers --envelope-id --signers '[{"userEmail":"..."}]' --confirm
Check available commands if needed:
npx @esignglobal/envelope-cli help
Create envelope example
npx @esignglobal/envelope-cli create-envelope --subject "Service Agreement" --remark "Please review and send" --expire 604800
Sender view example
# Step 1: create a draft envelope
npx @esignglobal/envelope-cli create-envelope --subject "Offer Letter"Step 2: get the interactive sender view URL
npx @esignglobal/envelope-cli sender-view --envelope-id --return-url "https://app.example.com/done"
Send envelope example
npx @esignglobal/envelope-cli send-envelope --file "C:\\docs\\contract.pdf" --signers '[{"userName":"Bob Smith","userEmail":"bob@example.com"}]' --subject "Please sign this contract" --confirm
Get envelope example
npx @esignglobal/envelope-cli get-envelope --envelope-id abc123
Urge envelope example
# Send a reminder to pending signers (rate limit: once per 30 minutes per envelope)
npx @esignglobal/envelope-cli urge-envelope --envelope-id abc123
Cancel envelope example
npx @esignglobal/envelope-cli cancel-envelope --envelope-id abc123 --reason "Signer information was incorrect." --confirm
Download envelope example
# List signed files and their individual download URLs (requires envelope to be completed)
npx @esignglobal/envelope-cli download-envelope --envelope-id abc123 --type list
Verify signature example
npx @esignglobal/envelope-cli verify-signature --file "/tmp/signed_contract.pdf"
Add attachments example
# Add two attachments to a draft envelope
npx @esignglobal/envelope-cli add-attachments \
--envelope-id abc123 \
--file-keys '["fileKey1","fileKey2"]'
Delete attachments example
# Remove an attachment from a draft envelope
npx @esignglobal/envelope-cli delete-attachments \
--envelope-id abc123 \
--file-keys '["fileKey1"]' \
--confirm
Add CC example
# Add CC recipients to a draft or in-progress envelope
npx @esignglobal/envelope-cli add-cc \
--envelope-id abc123 \
--cc-infos '[{"userEmail":"alice@example.com","userName":"Alice"}]'
Delete CC example
# Remove a CC recipient from a draft envelope
npx @esignglobal/envelope-cli delete-cc \
--envelope-id abc123 \
--cc-infos '[{"userEmail":"alice@example.com"}]' \
--confirm
Add signers example
# Add two signers to a draft envelope with sequential signing order
npx @esignglobal/envelope-cli add-signers \
--envelope-id abc123 \
--signers '[{"userName":"Bob Smith","userEmail":"bob@example.com","signOrder":1},{"userName":"Alice Jones","userEmail":"alice@example.com","signOrder":2}]'
Delete signers example
# Remove a signer from a draft envelope
npx @esignglobal/envelope-cli delete-signers \
--envelope-id abc123 \
--signers '[{"userEmail":"bob@example.com"}]' \
--confirm
Contract compare example
# Compare two local PDF files
npx @esignglobal/envelope-cli contract-compare \
--standard-file "/tmp/contract_v1.pdf" \
--comparative-file "/tmp/contract_v2.pdf"Compare using existing file keys
npx @esignglobal/envelope-cli contract-compare \
--standard-file-key "standardFileKey" \
--comparative-file-key "comparativeFileKey"Ignore page headers/footers and specific punctuation
npx @esignglobal/envelope-cli contract-compare \
--standard-file "/tmp/contract_v1.pdf" \
--comparative-file "/tmp/contract_v2.pdf" \
--filter-header-footer \
--filter-symbols ".,γγ"
Template example
# Step 1: inspect the template fields
npx @esignglobal/envelope-cli get-template --template-id Step 2: render the template with field values
npx @esignglobal/envelope-cli render-template --template-id --fields '[{"fieldId":"","fieldValue":""}]'Step 3: poll until taskStatus is Succeeded (2)
npx @esignglobal/envelope-cli get-render-result --task-id Step 4: send the rendered document for signing using the returned fileKey
npx @esignglobal/envelope-cli send-envelope --file-key --signers '[{"userName":"Bob Smith","userEmail":"bob@example.com"}]' --subject "Please sign this document" --confirm
Required Configuration
npxESIGNGLOBAL_APIKEY must already be configured in the shell environmentCreate Envelope Workflow
1. Collect a subject from the user; optionally collect remark, expiry, redirect URL, and callback URL
2. Run create-envelope to create a draft envelope (status 0)
3. Return the envelopeId β it is needed for sender-view or further configuration
Sender View Workflow
1. Obtain a draft envelopeId (status 0) from the user or a previous create-envelope response
2. Collect a return-url from the user (required β the page to redirect to after the sender submits)
3. Optionally collect --starting-page, --submit-action, --no-back-button, or --lock preferences
4. Run sender-view to retrieve the interactive URL
5. Present the URL to the user β they can open it in a browser or embed it in an iframe to add documents, configure signers, and send the envelope
Safety Rules
sender-view for envelopes in Draft status (0); other statuses will be rejected by the APItcode token embedded in the URLRequired Inputs
envelopeId: draft envelope ID (status 0)returnUrl: valid https/http URL, max 2048 charactersSend Envelope Workflow
Two modes are supported β provide exactly one of --file or --file-key:
--file β upload and send a local PDF file--file-key β send a file already on the server (e.g. from get-render-result)1. Determine whether the user has a local file or an existing fileKey
2. Collect signer list and optional subject
3. If using --file, confirm the file is a .pdf at an absolute path
4. Run the external CLI command with --confirm
5. Return the CLI result to the user
Safety Rules
.pdf file--file and --file-key are mutually exclusiveRequired Inputs
filePath (or fileKey): absolute path to an existing local PDF file, or an existing file keysigners: JSON array of signer objectssubject: optional email or envelope subjectEach signer must include:
userNameuserEmailOptional field:
signOrder as an integer >= 1filePath
filePath must be an absolute path to an existing local PDF file.
Example:
/tmp/contract.pdf
signers
Each signer must include:
userNameuserEmailOptional field:
signOrder (integer, minimum 1)Single signer example:
[
{
"userName": "Bob Smith",
"userEmail": "bob@example.com"
}
]
Sequential signing example:
[
{
"userName": "Bob Smith",
"userEmail": "bob@example.com",
"signOrder": 1
},
{
"userName": "Alice Jones",
"userEmail": "alice@example.com",
"signOrder": 2
}
]
Parallel signing example:
[
{
"userName": "Bob Smith",
"userEmail": "bob@example.com",
"signOrder": 1
},
{
"userName": "Alice Jones",
"userEmail": "alice@example.com",
"signOrder": 1
}
]
Template Workflow
1. Run get-template to inspect the template fields (fieldId, fieldName, fieldType, required)
2. Run render-template with the collected field values β returns a taskId
3. Run get-render-result and poll until taskStatus is Succeeded (2) β returns a fileKey
4. Run send-envelope --file-key with the fileKey to send the rendered document for signing
Safety Rules
--file and --file-key are mutually exclusive; use --file-key when a fileKey is already availableRequired Inputs
templateId: template ID provided by the userfields: array of { fieldId, fieldValue } for required fieldssigners: signer list (same format as Send Envelope Workflow)Get Envelope Workflow
1. Obtain the envelopeId from the user or a previous send-envelope response
2. Run get-envelope to retrieve full envelope details
3. Present the status, signer progress, and document list to the user using the Get Envelope Output Format below
Envelope status codes: 0=Draft, 1=In Progress, 2=Completed, 3=Expired, 4=Declined, 5=Canceled
Signer status codes: 0=Pending, 1=Signing, 2=Signed
Get Envelope Output Format
Always present get-envelope results using this exact template:
π Contract Details: [subject]Current Status: [envelope_status_icon] [envelope_status_label]
Signing Progress:
β [icon] Initiator: [initiator.userName] ([initiator_status_label])
β [icon] Signer N: [userName] ([signer_status_label]) [bottleneck_marker]
β [icon] CC: [ccName] ([cc_status_label])
Envelope status icon and label mapping:
| Code | Icon | Label | |------|------|-------| | 0 | βͺ | Draft | | 1 | β³ | Waiting for Others | | 2 | β | Completed | | 3 | β | Expired | | 4 | β | Declined | | 5 | β | Canceled |
Initiator: always show as β
Sent
Signer status icon and label mapping:
| Code | Icon | Label | |------|------|-------| | 0 | βͺ | Pending | | 1 | β³ | Signing | | 2 | β | Signed |
Bottleneck marker: append <- Current Bottleneck to the first signer whose status is 0 (Pending) or 1 (Signing) when the envelope is In Progress.
CC status: always show as βͺ Pending Sync if envelope is not yet Completed, β
Synced if Completed.
Rules:
ccInfos is empty[subject] from the envelope response as the file nameget-envelope outputUrge Envelope Workflow
1. Confirm the envelope is in progress (status 1) before sending a reminder
2. Run urge-envelope to notify all pending signers
3. Inform the user that reminders are rate-limited to once every 30 minutes per envelope
Cancel Envelope Workflow
1. Confirm the reason for cancellation with the user before proceeding
2. Run cancel-envelope with --confirm β cancellation is irreversible
3. After cancellation the envelope is suspended and all signatures within it are invalid
Download Envelope Workflow
1. Obtain the envelopeId from a previous send-envelope response or from the user
2. Run --type list to check envelope status and retrieve individual file download URLs
3. If envelopeStatus is 2 (Completed), share the downloadUrl for each file with the user
4. If the envelope is not yet completed, inform the user and wait
Envelope status codes: 0=Draft, 1=Signing, 2=Completed, 3=Expired, 4=Rejected, 5=Voided
File types in the list response:
CONTRACT β the signed documentCERTIFICATE β the signing audit certificateATTACHMENT β any attachmentsCOMBINED β merged PDF (if enabled on the account)> Individual file download URLs are valid for 60 minutes. Download can only proceed when the envelope is Completed.
Verify Signature Workflow
1. Obtain an absolute path to a local PDF file from the user
2. Run verify-signature β no API key required, verification runs entirely offline
3. Parse and present the JSON result to the user
The command outputs:
integrity β true (unmodified) / false (tampered) / null (unknown)signatureCount β number of signatures foundisValid β true / false / null
- signer β common name from the signing certificate
- declaredTime β signing time (trusted timestamp preferred over local clock), UTC+08:00
- signatureAlgorithm β e.g. RSA / SHA-256
- timestampIssuer β TSA certificate issuer, or "Local time" when no trusted timestamp is present
- certificate.serialNumber, certificate.validFrom, certificate.validUntil> verify-signature works fully offline and does not require ESIGNGLOBAL_APIKEY.
Contract Compare Workflow
1. Determine whether the user has local PDF files or existing file keys for both the standard (baseline) and comparative documents
2. Optionally collect --filter-header-footer preference and any punctuation to ignore via --filter-symbols
3. Run contract-compare β if local paths are provided, the CLI uploads them automatically before comparing
4. Return the contractCompareUrl to the user so they can open it in a browser to review highlighted differences
Safety Rules
.pdf files when local files are given--standard-file and --standard-file-key are mutually exclusive; same for the comparative pairRequired Inputs
standardFile (or standardFileKey): absolute path to the baseline PDF, or an existing file keycomparativeFile (or comparativeFileKey): absolute path to the PDF to compare against, or an existing file keyOptional Inputs
--filter-header-footer: exclude headers and footers from comparison--filter-symbols: comma-separated punctuation marks to ignore (e.g. ".,γγ")Contract Compare Output Format
Present the result using this exact template:
Contract Comparison ReadyOpen the link below to view highlighted differences between the two documents:
[contractCompareUrl]
Comparison ID: {contractCompareBizId}
Rules:
contractCompareBizId for referenceAdd Attachments Workflow
1. Obtain a draft envelopeId (status 0) from the user or a previous create-envelope response
2. Collect the list of fileKey strings to attach (upload files first via the Upload Documents API if needed)
3. Run add-attachments with the envelope ID and file keys JSON array
4. Return the result to the user
Safety Rules
0)Delete Attachments Workflow
1. Obtain the envelopeId and the fileKey values to remove from the user
2. Confirm the deletion with the user before proceeding β it cannot be undone once the envelope is sent
3. Run delete-attachments with --confirm
4. Return the result to the user
Safety Rules
--confirm before proceedingAdd CC Workflow
1. Obtain the envelopeId from the user or a previous create-envelope / send-envelope response
2. Collect the list of CC recipients β each must have userEmail and userName
3. Run add-cc β supported for envelopes in Draft (0) or In Progress (1) status
4. Return the updated CC list to the user
Safety Rules
userName must not contain these special characters: / \ : * " < > | οΌ or emojiRequired Inputs
envelopeId: envelope ID (Draft or In Progress)ccInfos: JSON array of { userEmail, userName } objectsDelete CC Workflow
1. Obtain the envelopeId and the email addresses of CC recipients to remove from the user
2. Confirm the deletion with the user before proceeding
3. Run delete-cc with --confirm β only supported for envelopes in Draft status (0)
4. Return the remaining CC list to the user
Safety Rules
0)--confirm before proceedingRequired Inputs
envelopeId: draft envelope ID (status 0)ccInfos: JSON array of { userEmail } objects to removeAdd Signers Workflow
1. Obtain a draft envelopeId (status 0) from the user or a previous create-envelope response
2. Collect the list of signers β each must have userName, userEmail, and signOrder
3. Run add-signers β new signers can only be appended after existing ones; inserting before a current or completed signer is rejected by the API
4. Return the updated signer list to the user
Safety Rules
0)userName must not contain these special characters: / \ : * " < > | ? or emojiRequired Inputs
envelopeId: draft envelope ID (status 0)signers: JSON array of { userName, userEmail, signOrder } objectsOptional Signer Fields
businessId: developer-defined business numberdeliveryMethods: auto (default), none, email, sms, WhatsAppfreeFormSign: true to allow free stamp/signature placementauthModes: noAuth (default), accessCode, sms, emailAuth, etc.Delete Signers Workflow
1. Obtain the envelopeId and the email addresses of signers to remove from the user
2. Confirm the deletion with the user before proceeding
3. Run delete-signers with --confirm β only supported for envelopes in Draft status (0)
4. Return the remaining signer list to the user
Safety Rules
0)--confirm before proceedingRequired Inputs
envelopeId: draft envelope ID (status 0)signers: JSON array of { userEmail } objects to removeOutput
Return the external CLI result. Do not bundle or implement upload logic inside this skill.
Verify Signature Output Format
Present each signature using this exact template:
Signature is VALID
(or Signature is INVALID / Signature status unknown )Signer:
{signer}
Signing Time:
{declaredTime}
Signature Time Source:
{timestampIssuer}
Signature Algorithm:
{signatureAlgorithm}
Signer Certificate
Serial Number:
{certificate.serialNumber}
Valid From:
{certificate.validFrom}
Valid Until:
{certificate.validUntil}
Rules:
isValid === true or isValid === false;Support
If you encounter any issues during invocation, visit the official website at https://www.esignglobal.com?source=agent to submit a support ticket.
βοΈ Configuration
Before calling any send action, set ESIGNGLOBAL_APIKEY in the shell environment.
If the user does not already have an api key, direct them to:
1. Sign in at https://www.esignglobal.com?source=agent
2. Open Settings -> Integration -> Apps
3. Create an application and copy the generated api key
# Windows PowerShell
$env:ESIGNGLOBAL_APIKEY="your_api_key"macOS / Linux
export ESIGNGLOBAL_APIKEY="your_api_key"Verify connectivity
npx @esignglobal/envelope-cli config health
Credential handling rules:
ESIGNGLOBAL_APIKEY