Skip to content

Commit

Permalink
[PoC] Labs metadata
Browse files Browse the repository at this point in the history
See databricks/cli#637 for more context
  • Loading branch information
nfx committed Aug 7, 2023
1 parent 34bd186 commit 7bbce0c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import os

print(f'host is {os.environ["DATABRICKS_HOST"]}')
22 changes: 22 additions & 0 deletions labs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: dbx
context: workspace
description: Databricks CLI extensions
hooks:
install: install.py
entrypoint: main.py
commands:
- name: foo
description: foo command
flags:
- name: first
description: first flag description
- name: second
description: second flag description
- name: bar
description: bar command
flags:
- name: first
description: first flag description
- name: second
description: second flag description
14 changes: 14 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os, sys, json

print(f'host is {os.environ["DATABRICKS_HOST"]}')

payload = json.loads(sys.argv[1])
print(f'[{payload["command"]}]: flags are {payload["flags"]}')

answer = input('What is your name? ')

print(f'got answer: {answer}')

answer = input('Preferences? ')

print(f'got answer: {answer}')

0 comments on commit 7bbce0c

Please sign in to comment.